News for hackers. Stuff that matters.
Re:Coroutines for Go by geodel on Monday July 17, 2023 @04:26PM (#36763580)
Where did you get this '..it uses same under the hood'? The article clearly says:

..Next I added a direct coroutine switch to the runtime, avoiding channels entirely. That cuts the coroutine switch to three atomic compare-and-swaps (one in the coroutine data structure, one for the scheduler status of the blocking coroutine, and one for the scheduler status of the resuming coroutine), which I believe is optimal given the safety invariants that must be maintained. That implementation takes 20ns per switch, or 40ns per pulled value. This is about 10X faster than the original channel implementation.

Re:Coroutines for Go by vaastav on Monday July 17, 2023 @04:32PM (#36763649)
The runtime switch was buried in the last paragraph of the article. All of the code was using goroutines and channels....
Re:Coroutines for Go by geodel on Monday July 17, 2023 @04:36PM (#36763707)
It does mention in an earlier section:

... That means the definition of coroutines should be possible to implement and understand in terms of ordinary Go code. Later, I will argue for an optimized implementation provided directly by the runtime,..