Re: Does Python Need Virtual Threads? (Posting On Python-List Prohibited)

Lawrence D'Oliveiro <[email protected]> Mon, 16 Jun 2025 01:14:34 -0000 (UTC)
Newsgroups comp.lang.python
Organization A noiseless patient Spider
Message-ID <[email protected]>
On Sun, 15 Jun 2025 14:33:28 -0700, Paul Rubin wrote:

> Lawrence D'Oliveiro <[email protected]> writes:
>>
>>> Let's see how CPython holds up with a million OS threads running.
>>
>> Linux can already run hundreds of thousands of processes/threads
> 
> To misquote Austin Powers, "one MILLLLLION threads".  Here Erlang does
> it in less than 1GB of memory:
> 
> https://hauleth.dev/post/beam-process-memory-usage/

Just a note that Erlang dates from before the current state of CPU 
architectures, where you have a 100:1 disparity between RAM-access speeds 
and CPU register-access speeds.

In other words, you do not want to copy stuff between processes if you can 
help it. With threads sharing common memory, that data can reside in 
caches that multiple threads in the same process context can share without 
copying.