News for hackers. Stuff that matters.
Re:Async-await on stable Rust by brandonbloom on Thursday November 07, 2019 @02:41PM (#21476570)
Go creates the illusion of preemptive multithreading by having implicit safe-points for cooperative multithreading. Each IO operation is such a safe-point. If you write an infinite loop like `for {}` where there are no IO operations in loop body, it will block indefinitely. This will prevent the underlying OS thread from being available to other goroutines. The same thing can happen even if you do have IO operations in there, but the work being performed is dominated by CPU time instead of IO.
Re:Async-await on stable Rust by crawshaw on Thursday November 07, 2019 @06:41PM (#21478615)
Note that this is being fixed in the next release: https://golang.org/issue/10958
Re:Async-await on stable Rust by littlestymaar on Friday November 08, 2019 @02:08AM (#21480465)
That's cool it's finally coming, this issue is open since 2015! I wonder which performance impact this will have.
Re:Async-await on stable Rust by jdc on Thursday November 07, 2019 @03:28PM (#21476945)
Maybe this is a dumb question, but what if a language with implicit safepoints lets you opt out with something like a nosafepoint block/pragma?