<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Syscalls on Moonstreet</title>
    <link>https://www.moonstreet.nl/tags/syscalls/</link>
    <description>Recent content in Syscalls on Moonstreet</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>Copyright © 2008–2018, Steve Francia and the Hugo Authors; all rights reserved.</copyright>
    <lastBuildDate>Sat, 28 Nov 2026 00:00:00 +0100</lastBuildDate><atom:link href="https://www.moonstreet.nl/tags/syscalls/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Concurrency refresher: threads, event loops, and syscalls</title>
      <link>https://www.moonstreet.nl/post/concurrency-refresher/</link>
      <pubDate>Sat, 28 Nov 2026 00:00:00 +0100</pubDate>
      
      <guid>https://www.moonstreet.nl/post/concurrency-refresher/</guid>
      <description>
        
          
            &lt;h2 id=&#34;why-this-post&#34;&gt;Why this post&lt;/h2&gt;
&lt;p&gt;I keep mixing up concurrency and parallelism, forgetting what an event
loop actually does, and losing track of where blocking happens. This is
my reference. See also: &lt;a href=&#34;https://www.moonstreet.nl/post/containers-refresher/&#34;&gt;Containers refresher&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;single-threaded-vs-multi-threaded&#34;&gt;Single-threaded vs multi-threaded&lt;/h2&gt;
&lt;h3 id=&#34;single-threaded-one-worker&#34;&gt;Single-threaded: one worker&lt;/h3&gt;
&lt;p&gt;One thing at a time. Task 2 waits for Task 1 to finish.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;Task 1: ████████░░░░░░░░░░░░  (working)
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;Task 2: ░░░░░░░░████████░░░░  (waiting, then working)
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;Task 3: ░░░░░░░░░░░░░░░░████  (waiting, then working)
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                ─────────────────────►
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;                          time
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;multi-threaded-multiple-workers&#34;&gt;Multi-threaded: multiple workers&lt;/h3&gt;
&lt;p&gt;All tasks run at the same time - if you have enough CPU cores.&lt;/p&gt;
          
          
        
      </description>
    </item>
    
  </channel>
</rss>
