Sujet : Re: Does Python Need Virtual Threads? (Posting On Python-List Prohibited)
De : no.email (at) *nospam* nospam.invalid (Paul Rubin)
Groupes : comp.lang.pythonDate : 15. Jun 2025, 02:25:26
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87y0tt23uh.fsf@nightsong.com>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Lawrence D'Oliveiro <
ldo@nz.invalid> writes:
Try using Erlang a little, It has preemptive lightweight processes and
it is great. Much better than async/await imho.
>
Those are called “threads”. Python already has those, and the ongoing
“noGIL” project will make them even more useful.
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. Programming with them in an Erlang-like style still can work
pretty well.