<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Concurrency on Artur Meski</title>
    <link>https://meski.io/tags/concurrency/</link>
    <description>Recent content in Concurrency on Artur Meski</description>
    <generator>Hugo</generator>
    <language>en-gb</language>
    <lastBuildDate>Wed, 23 Jun 2021 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://meski.io/tags/concurrency/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Basic concurrency with fork()</title>
      <link>https://meski.io/posts/concurrency-unix-fork/</link>
      <pubDate>Wed, 23 Jun 2021 00:00:00 +0000</pubDate>
      <guid>https://meski.io/posts/concurrency-unix-fork/</guid>
      <description>&lt;p&gt;When programming on Linux/Unix, the function &lt;a href=&#34;https://man.openbsd.org/fork&#34; target=&#34;_blank&#34;&gt;fork(2)&lt;/a&gt; allows us to create new processes.&#xA;This is a short and example-driven introduction to the basics of using that function.&lt;/p&gt;&#xA;&lt;h1 id=&#34;first-stab&#34;&gt;First stab&lt;/h1&gt;&#xA;&lt;p&gt;After a brief look at the manual page for &lt;a href=&#34;https://man.openbsd.org/fork&#34; target=&#34;_blank&#34;&gt;fork(2)&lt;/a&gt; we can tell that it returns a value of type &lt;em&gt;pid_t&lt;/em&gt; and does not take any arguments:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME&#xA;     fork – create a new process&#xA;&#xA;SYNOPSIS&#xA;     #include &amp;lt;unistd.h&amp;gt;&#xA;&#xA;     pid_t&#xA;     fork(void);&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Let us simply call &lt;em&gt;fork&lt;/em&gt; and see what happens and what values does it return.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
