<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Semaphore on cassiobotaro</title><link>https://cassiobotaro.dev/en/tags/semaphore/</link><description>Recent content in Semaphore on cassiobotaro</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 26 Oct 2026 19:53:30 -0300</lastBuildDate><atom:link href="https://cassiobotaro.dev/en/tags/semaphore/index.xml" rel="self" type="application/rss+xml"/><item><title>Go Concurrency - Semaphore</title><link>https://cassiobotaro.dev/en/posts/go-concurrency-semaphore/</link><pubDate>Thu, 29 Oct 2026 00:00:00 -0300</pubDate><guid>https://cassiobotaro.dev/en/posts/go-concurrency-semaphore/</guid><description>&lt;video
 src="https://cassiobotaro.dev/videos/semaforo.mp4"
 title="Ten tasks competing for three slots" aria-label="Ten tasks competing for three slots"
 autoplay
 loop
 muted
 playsinline
 controls
 preload="metadata"
 style="width: 100%; height: auto;"&gt;
&lt;/video&gt;

&lt;p&gt;In the &lt;a href="https://cassiobotaro.dev/en/posts/go-concurrency-worker-pool/" &gt;worker pool&lt;/a&gt; I fixed how many goroutines exist. In &lt;a href="https://cassiobotaro.dev/en/posts/go-concurrency-backpressure/" &gt;backpressure&lt;/a&gt; a channel&amp;rsquo;s capacity held the producer back.&lt;/p&gt;
&lt;p&gt;But what if I have ten files to download, and the server kicks out anyone who opens more than three connections? I want one goroutine per file, and only three of them downloading at the same time.&lt;/p&gt;</description></item></channel></rss>