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

Lawrence D'Oliveiro <[email protected]> Sun, 15 Jun 2025 02:13:33 -0000 (UTC)
Newsgroups comp.lang.python
Organization A noiseless patient Spider
Message-ID <[email protected]>
On Sat, 14 Jun 2025 18:25:26 -0700, Paul Rubin wrote:

> Erlang's lightweight processes are called "processes" rather than
> "threads" since they don't give the appearance of having shared memory.
> They communicate by passing data through channels.  From the
> application's perspective, that is always done by copying the data,
> although the VM sometimes optimizes away the copying behind the scenes.
> 
> Python has OS threads but they are way more expensive than Erlang
> processes.

Sharing process context is cheaper than having to keep copying data back 
and forth. Clever tricks with the paging hardware can often be more 
trouble than they’re worth.

Remember, Python’s threads are OS threads. If you’re thinking “expensive”, 
you must be assuming “Microsoft Windows”.