Sujet : Re: Does Python Need Virtual Threads? (Posting On Python-List Prohibited)
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.pythonDate : 15. Jun 2025, 03:13:33
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <102la8c$l3km$5@dont-email.me>
References : 1 2 3 4
User-Agent : Pan/0.162 (Pokrosvk)
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”.