<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Goroutines on Rafiul Alam</title>
    <link>https://alamrafiul.com/tags/goroutines/</link>
    <description>Recent content in Goroutines on Rafiul Alam</description>
    <image>
      <title>Rafiul Alam</title>
      <url>https://alamrafiul.com/papermod-cover.png</url>
      <link>https://alamrafiul.com/papermod-cover.png</link>
    </image>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Tue, 18 Nov 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://alamrafiul.com/tags/goroutines/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Complete Guide to Go Concurrency Patterns: Visual Patterns &amp; Code Examples</title>
      <link>https://alamrafiul.com/posts/go-concurrency-patterns-comprehensive/</link>
      <pubDate>Tue, 18 Nov 2025 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/go-concurrency-patterns-comprehensive/</guid>
      <description>Master all essential Go concurrency patterns with mermaid visualizations and practical code examples. From basic goroutines to advanced patterns like worker pools, fan-in/out, pipelines, and more.</description>
    </item>
    
    <item>
      <title>Producer-Consumer: The Unbounded Buffer</title>
      <link>https://alamrafiul.com/blogs/producer-consumer-unbounded/</link>
      <pubDate>Sat, 15 Nov 2025 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/blogs/producer-consumer-unbounded/</guid>
      <description>&lt;h2 id=&#34;the-producer-consumer-problem&#34;&gt;The Producer-Consumer Problem&lt;/h2&gt;
&lt;p&gt;The Producer-Consumer pattern is one of the most fundamental concurrency patterns. It appears everywhere in modern software:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Message queues&lt;/strong&gt; (RabbitMQ, Kafka, SQS)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Task processing&lt;/strong&gt; (background jobs, worker pools)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data pipelines&lt;/strong&gt; (ETL, streaming analytics)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Event systems&lt;/strong&gt; (event buses, pub/sub)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Buffering&lt;/strong&gt; (I/O buffers, network buffers)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The Setup&lt;/strong&gt;: Producers generate data, consumers process it. They run concurrently and need to coordinate through a shared buffer.&lt;/p&gt;
&lt;h2 id=&#34;the-unbounded-buffer-variant&#34;&gt;The Unbounded Buffer Variant&lt;/h2&gt;
&lt;p&gt;In this first variant, we use an &lt;strong&gt;unbounded buffer&lt;/strong&gt; - the queue can grow infinitely (until we run out of memory). This is the simplest version and showcases Go&amp;rsquo;s beautiful channel abstraction.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Golang Experiments: Classic Concurrency Problems</title>
      <link>https://alamrafiul.com/blogs/golang-experiments-classic-concurrency/</link>
      <pubDate>Mon, 20 Oct 2025 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/blogs/golang-experiments-classic-concurrency/</guid>
      <description>&lt;h2 id=&#34;welcome-to-golang-experiments&#34;&gt;Welcome to Golang Experiments!&lt;/h2&gt;
&lt;p&gt;This series explores &lt;strong&gt;classic concurrency problems&lt;/strong&gt; through the lens of Go&amp;rsquo;s powerful concurrency primitives. Each problem is a timeless synchronization challenge that teaches fundamental concepts you&amp;rsquo;ll use in production systems every day.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Go&amp;rsquo;s concurrency features (goroutines, channels, sync primitives)&lt;/li&gt;
&lt;li&gt;How to recognize and solve common synchronization problems&lt;/li&gt;
&lt;li&gt;Patterns that appear in real-world distributed systems&lt;/li&gt;
&lt;li&gt;When to use different synchronization strategies&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;why-study-classic-problems&#34;&gt;Why Study Classic Problems?&lt;/h2&gt;
&lt;p&gt;These aren&amp;rsquo;t just academic exercises! Each problem represents a pattern you&amp;rsquo;ll encounter in production:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Building a Real-Time File Monitor with Goroutines and Channels</title>
      <link>https://alamrafiul.com/posts/golang-realtime-file-monitor/</link>
      <pubDate>Fri, 03 Oct 2025 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/golang-realtime-file-monitor/</guid>
      <description>&lt;p&gt;File monitoring is a common requirement in many applications: watching for configuration changes, processing uploads, syncing directories, or building development tools. In this post, we&amp;rsquo;ll build a production-ready file monitoring service that tracks word counts across all files in a directory using Go&amp;rsquo;s powerful concurrency primitives.&lt;/p&gt;
&lt;h2 id=&#34;the-challenge&#34;&gt;The Challenge&lt;/h2&gt;
&lt;p&gt;Build a service that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Monitors a directory and all its subdirectories&lt;/li&gt;
&lt;li&gt;Counts words in all files in real-time&lt;/li&gt;
&lt;li&gt;Updates counts when files are modified, created, or deleted&lt;/li&gt;
&lt;li&gt;Processes multiple files concurrently&lt;/li&gt;
&lt;li&gt;Provides current statistics on demand&lt;/li&gt;
&lt;li&gt;Handles errors gracefully&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;why-this-matters&#34;&gt;Why This Matters&lt;/h2&gt;
&lt;p&gt;Real-time file monitoring powers many production systems:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Mastering Go Concurrency: The Coffee Shop Guide to Goroutines</title>
      <link>https://alamrafiul.com/posts/go-goroutines-coffee-shop/</link>
      <pubDate>Sun, 15 Dec 2024 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/go-goroutines-coffee-shop/</guid>
      <description>&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Go Concurrency Patterns Series:&lt;/strong&gt;
&lt;a href=&#34;https://alamrafiul.com/concurrency-patterns/&#34;&gt;Series Overview&lt;/a&gt; | &lt;a href=&#34;https://alamrafiul.com/posts/go-goroutine-basics/&#34;&gt;Goroutine Basics&lt;/a&gt; | &lt;a href=&#34;https://alamrafiul.com/posts/go-channel-fundamentals/&#34;&gt;Channel Fundamentals&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;introduction-welcome-to-go-coffee-shop&#34;&gt;Introduction: Welcome to Go Coffee Shop&lt;/h2&gt;
&lt;p&gt;Imagine running a busy coffee shop. You have customers placing orders, baristas making drinks, shared equipment like espresso machines and milk steamers, and the constant challenge of managing it all efficiently. This is exactly what concurrent programming in Go is like - and goroutines are your baristas!&lt;/p&gt;
&lt;p&gt;In this comprehensive guide, we&amp;rsquo;ll explore Go&amp;rsquo;s concurrency patterns through the lens of running a coffee shop. By the end, you&amp;rsquo;ll understand not just how to write concurrent Go code, but why these patterns work and when to use them.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Worker Pool Pattern in Go</title>
      <link>https://alamrafiul.com/posts/go-worker-pool/</link>
      <pubDate>Wed, 21 Aug 2024 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/go-worker-pool/</guid>
      <description>Learn how to implement the Worker Pool pattern in Go for efficient resource management and bounded concurrency with practical examples.</description>
    </item>
    
    <item>
      <title>Pub/Sub Pattern in Go</title>
      <link>https://alamrafiul.com/posts/go-pub-sub/</link>
      <pubDate>Wed, 17 Jul 2024 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/go-pub-sub/</guid>
      <description>Learn how to implement the Publisher/Subscriber pattern in Go for event-driven communication and decoupled messaging systems.</description>
    </item>
    
    <item>
      <title>Fan-Out/Fan-In Pattern in Go</title>
      <link>https://alamrafiul.com/posts/go-fan-out-fan-in/</link>
      <pubDate>Wed, 26 Jun 2024 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/go-fan-out-fan-in/</guid>
      <description>Learn how to implement the Fan-Out/Fan-In pattern in Go for distributing work across multiple goroutines and collecting results efficiently.</description>
    </item>
    
    <item>
      <title>Go Memory Model Explained</title>
      <link>https://alamrafiul.com/posts/go-memory-model/</link>
      <pubDate>Tue, 25 Jun 2024 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/go-memory-model/</guid>
      <description>Deep dive into Go&amp;#39;s memory model, happens-before relationships, memory visibility guarantees, and what really happens with goroutines and shared memory.</description>
    </item>
    
    <item>
      <title>Go Concurrency Pattern: Goroutine Basics</title>
      <link>https://alamrafiul.com/posts/go-goroutine-basics/</link>
      <pubDate>Wed, 12 Jun 2024 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/go-goroutine-basics/</guid>
      <description>&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Go Concurrency Patterns Series:&lt;/strong&gt;
&lt;a href=&#34;https://alamrafiul.com/concurrency-patterns/&#34;&gt;Series Overview&lt;/a&gt; | &lt;a href=&#34;https://alamrafiul.com/posts/go-channel-fundamentals/&#34;&gt;Channel Fundamentals →&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;what-are-goroutines&#34;&gt;What are Goroutines?&lt;/h2&gt;
&lt;p&gt;Goroutines are lightweight threads managed by the Go runtime. They&amp;rsquo;re one of Go&amp;rsquo;s most powerful features, allowing you to write concurrent programs that can handle thousands of simultaneous operations with minimal overhead. Think of goroutines as extremely efficient workers that can run independently while sharing the same memory space.&lt;/p&gt;
&lt;p&gt;Unlike traditional threads that typically consume 1-2MB of memory each, goroutines start with just 2KB of stack space and grow as needed. This efficiency allows Go programs to spawn millions of goroutines without overwhelming system resources.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
