Path: csiph.com!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Mild Shock Newsgroups: comp.lang.python Subject: Re: Does Python Need Virtual Threads? (Posting On Python-List Prohibited) Date: Sat, 14 Jun 2025 23:23:23 +0200 Message-ID: <102kp89$q8c6$1@solani.org> References: <102isqb$3v5j0$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 14 Jun 2025 21:23:21 -0000 (UTC) Injection-Info: solani.org; logging-data="860550"; mail-complaints-to="abuse@news.solani.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0 SeaMonkey/2.53.21 Cancel-Lock: sha1:HtuGk1OdXYXEGOAa5FyQynwZ1vY= In-Reply-To: <102isqb$3v5j0$2@dont-email.me> X-User-ID: eJwNyskBwCAIBMCWcFeuchBD/yXEz7xGacvat6ltHR2sK3Z4shbYGHGNyMFkERkYXBUn30M2eV1anhVXKub7AS9cFMk= Xref: csiph.com comp.lang.python:197512 Concerning virtual threads the only problem with Java I have is, that JDK 17 doesn't have them. And some linux distributions are stuck with JDK 17. Otherwise its not an idea that belongs solely to Java, I think golang pioniered them with their goroutines. I am planning to use them more heavily when they become more widely available, and I don't see any principle objection that Python wouldn't have them as well. It would make async I/O based on async waithing for a thread maybe more lightweight. But this would be only important if you have a high number of tasks. Lawrence D'Oliveiro schrieb: > Short answer: no. > > > > Firstly, anybody appealing to Java as an example of how to design a > programming language should immediately be sending your bullshit detector > into the yellow zone. > > Secondly, the link to a critique of JavaScript that dates from 2015, from > before the language acquired its async/await constructs, should be another > warning sign. > > Looking at that Java spec, a “virtual thread” is just another name for > “stackful coroutine”. Because that’s what you get when you take away > implicit thread preemption and substitute explicit preemption instead. > > The continuation concept is useful in its own right. Why not concentrate > on implementing that as a new primitive instead? >