News for hackers. Stuff that matters.
Re:No-GIL mode coming for Python by dingi on Friday July 28, 2023 @11:46PM (#36916668)
I’m genuinely curious, What's wrong with Java's model?
Re:No-GIL mode coming for Python by mrkeen on Saturday July 29, 2023 @11:41AM (#36921333)
* It's hard to program correctly using the thread model. And saying that locks are the solution to thread safety issues in Java, is like saying that malloc/free is the solution to memory safety issues in C.

* Threads are also relatively fat. You'd probably think twice about spinning up 1000 of them.

* Futures came in with Java 8 and are lighter weight, but have certain implementation defects - can't cancel them for example. Although there are some instances in which regular threads aren't cancellable. Also, the API isn't terribly popular. I happen to like flatmapping my way around a codebase, but plenty of devs' eyes glaze over when they read that code.

* Fibers are released I think - at least in beta. More like JS's model I believe. They're even lighter weight and get rid of the flatmappy stuff again. I assume it's still up to the programmer to get the locking right.