<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Javascript on Khang Nghiem</title><link>https://www.khangnghiem.com/tags/javascript/</link><description>Recent content in Javascript on Khang Nghiem</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 23 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.khangnghiem.com/tags/javascript/index.xml" rel="self" type="application/rss+xml"/><item><title>Is Node.js Really Single-Threaded?</title><link>https://www.khangnghiem.com/post/nodejs-single-threaded/</link><pubDate>Tue, 23 Jun 2026 00:00:00 +0000</pubDate><guid>https://www.khangnghiem.com/post/nodejs-single-threaded/</guid><description>&lt;p&gt;&amp;ldquo;Node.js is single-threaded.&amp;rdquo; You&amp;rsquo;ve probably heard this. It&amp;rsquo;s true. And also kind of misleading.&lt;/p&gt;
&lt;p&gt;If it only has one thread, how does it handle thousands of connections?&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="what-most-people-assume"&gt;What most people assume&lt;/h2&gt;
&lt;p&gt;Coming from Java or Python, developers expect:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Request 1 gets Thread 1&lt;/li&gt;
&lt;li&gt;Request 2 gets Thread 2&lt;/li&gt;
&lt;li&gt;Request 3 gets Thread 3&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One thread means one request at a time. That would make Node.js useless for any real server. But that&amp;rsquo;s not how it works.&lt;/p&gt;</description></item></channel></rss>