News for hackers. Stuff that matters.
Re:Tokio 1.0 – async runtime for Rust by 10000truths on Wednesday December 23, 2020 @04:54PM (#25522680)
OS threads are preemptive and their scheduling is beyond your control, which introduces potential data races. Green threads allow for cooperative scheduling, which is much harder to mess up.
Re:Tokio 1.0 – async runtime for Rust by Yoric on Wednesday December 23, 2020 @05:56PM (#25523257)
In my experience, past some level of code complexity, you get the pretty much same kind of races with cooperative scheduling as with preemptive scheduling – with the added risk that you did not expect a race with preemptive scheduling.

Still a fan of async programming, but that's a false benefit in my books :)

Re:Tokio 1.0 – async runtime for Rust by sanxiyn on Wednesday December 23, 2020 @04:58PM (#25522728)
This is moot. Rust prevents data races.
Re:Tokio 1.0 – async runtime for Rust by brundolf on Wednesday December 23, 2020 @05:14PM (#25522887)
It doesn't prevent race conditions, which may be what the GP meant to say