3 ms·
> without using a bunch of excess thread context resources If the threads are cheap, there is no point in making this distinction, which greatly simplifies the
by fiedzia 3y ago
> without using a bunch of excess thread context resources
If the threads are cheap, there is no point in making this distinction, which greatly simplifies the language. And they can be, we just need programming languages designed for that.
- ttfkam 3y agoSome people, when confronted with a problem, think, “I know, I’ll use threads,” and then two they hav erpoblesms. – Ned Batchelder
- ttfkam 3y agoNon-blocking I/O channels use fewer threads (native or green) than tasks. Some programming languages ARE designed to handle this: they use async/await. You could argue that Go does this more elegantly with goroutines, but this further highlights the point that threads should not be a silver bullet to development models.
- the_biot 3y agoHere, here. The elephant in the room in just about any discussion about threads/async is Python. Threads simply don't function in Python because of the GIL. Instead of accepting this fact and using another language if threads are needed, Python has been doing various async-style things for years and pretending it's good enough, including what can only be described as cooperative multitasking, that horror from the early 90s.
- fiedzia 3y agoPython is working on removing GIL (I am not sure about timeframe) and will have subinterpreters - the last one will come in 3.13 and solves the thread problem.