<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ashraf Hossain</title>
    <description>The latest articles on DEV Community by Ashraf Hossain (@ashraf_hossain_69c0b66d97).</description>
    <link>https://dev.to/ashraf_hossain_69c0b66d97</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3578750%2F31d6783e-e61d-41c2-8ff4-b0db6a97e375.png</url>
      <title>DEV Community: Ashraf Hossain</title>
      <link>https://dev.to/ashraf_hossain_69c0b66d97</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ashraf_hossain_69c0b66d97"/>
    <language>en</language>
    <item>
      <title>Why this simple Golang process uses 4 threads?</title>
      <dc:creator>Ashraf Hossain</dc:creator>
      <pubDate>Wed, 22 Oct 2025 16:14:00 +0000</pubDate>
      <link>https://dev.to/ashraf_hossain_69c0b66d97/why-this-simple-golang-process-uses-4-threads-83f</link>
      <guid>https://dev.to/ashraf_hossain_69c0b66d97/why-this-simple-golang-process-uses-4-threads-83f</guid>
      <description>&lt;p&gt;Exploring Threads in C vs Go — A Curious Experiment 🧵&lt;/p&gt;

&lt;p&gt;Recently, I was experimenting with C and Go, and something interesting caught my eye. I wanted to see how many threads each language uses when running a simple program.&lt;/p&gt;

&lt;p&gt;So, I wrote two nearly identical programs — one in C and one in Go — compiled and ran them. To my surprise, the C program used only 1 thread, while the Go program spun up 4 threads, even though their logic was exactly the same!&lt;/p&gt;

&lt;p&gt;Here’s what I found and how I tested it 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnhfqo3vpr5944petewmr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnhfqo3vpr5944petewmr.png" alt=" " width="713" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fysodg67pj89wi7lcxq85.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fysodg67pj89wi7lcxq85.png" alt=" " width="800" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxahwza3q2gklxeey8m4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxahwza3q2gklxeey8m4.png" alt=" " width="624" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvyjgmuguolg5goq0x7v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvyjgmuguolg5goq0x7v.png" alt=" " width="800" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51pfzgox9o2179x0xodc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51pfzgox9o2179x0xodc.png" alt=" " width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>go</category>
      <category>c</category>
    </item>
  </channel>
</rss>
