Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: Does Python Need Virtual Threads? (Posting On Python-List Prohibited) Date: Sat, 14 Jun 2025 18:25:26 -0700 Organization: A noiseless patient Spider Lines: 16 Message-ID: <87y0tt23uh.fsf@nightsong.com> References: <102isqb$3v5j0$2@dont-email.me> <8734c236kc.fsf@nightsong.com> <102kvhu$fjtb$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 15 Jun 2025 03:25:27 +0200 (CEST) Injection-Info: dont-email.me; posting-host="b50a8f7396ecb776e9421cded45e3d3b"; logging-data="561269"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19UQS98dbgngqTr/ucVqsBG" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:HkZWFDCXVhWuE4sM/Ntt3IgDpZc= sha1:hlOk3nsx1dFSQtdE19B4MREZE+M= Xref: csiph.com comp.lang.python:197514 Lawrence D'Oliveiro 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.