3 ms·
> After all the hoopla surrounding concurrency models, it seems that languages are conceding that green threads are more ergonomic to work with. Go and Java hav
by lmm 4y ago
> After all the hoopla surrounding concurrency models, it seems that languages are conceding that green threads are more ergonomic to work with. Go and Java have it, and now .NET is even experimenting with it.
Green threads were always better, the issue was compatibility with native (C) libraries. 20 years ago a language whose C FFI was as cumbersome as Go's would be laughed at.
> How long until OS vendors introduce abstractions to make this easier? Why aren't there OS-native green threads, or at the very least user-space scheduling affordances for runtimes that want to implement them without overhead in calling blocking code?
Most of the point of green threads is to avoid the OS getting in the way. Rather than OSes adding green threading, the future looks like sidestepping more and more of the traditional OS, ending up with unikernels or something that looks like them. The likes of graal native image are already a step in this direction.
- smasher164 4y ago> Green threads were always better There’s a lot of people who advocate otherwise, but I don’t think we have the mechanisms for effect polymorphism in current languages good enough to make effects ergonomic. > Most of the point of green threads is to avoid the OS getting in the way. I see the OS as an environment to help me run programs. Language runtimes have been taking over that role over the last few decades, sure. However, whether or not unikernels are the way forward remains to be seen. I still see it worthwhile to improve the OS, however.
- pjmlp 4y agoThe extent of the OS relevancy is inversely proportionaly to the richness of the language runtime and ecosystem. Or as Dan Ingalls from Smalltalk fame would put it, "an operating system is a collection of things that don't fit inside a language; there shouldn't be one". Incidently that is pretty much true for those of us doing distributed computing in cloud environments with managed languages, their runtimes could even be running directly on top of type 1 hypervisor for what I care.