3 ms·
People care about performance a lot, especially when writing evented I/O. The explicitness is pretty useful at preventing unexpected performance cliffs. One o
by rdw 5y ago
People care about performance a lot, especially when writing evented I/O. The explicitness is pretty useful at preventing unexpected performance cliffs.
One of the main pieces of feedback I heard about green threads is that they are "just as confusing" as threads. Developers tend to view preemptive multitasking as a difficult-to-manage hazard. Non-explicit async is not technically preemptive, but, most developers won't know which functions are going to cause a context switch, and it can change from one version to the next. So they kinda end up assuming they're all gonna context switch, so they put mutexes on things and basically do all the tedious and annoying work that threading entails. It's simultaneously "too much magic" and "not enough magic".
That said, Ruby's new green threading stuff [1] is very exciting, has the potential to revitalize the concept, and we'll just have to see how things turn out in the next five years.
[1] http://www.wjwh.eu/posts/2020-12-28-ruby-fiber-scheduler-c-extension.html http://www.wjwh.eu/posts/2020-12-28-ruby-fiber-scheduler-c-e...