News for hackers. Stuff that matters.
Re:Niklaus Wirth has died by pjmlp on Thursday January 04, 2024 @03:09AM (#38864451)
In .NET and C++ asynchronous programming is not cooperative, it hides the machinery of a state machine mapping tasks into threads, it gets prempted and you can write your own scheduler.
Re:Niklaus Wirth has died by funcDropShadow on Thursday January 04, 2024 @03:16AM (#38864483)
But, isn't the separation of the control-flow into chunks, either separated by async/await or by sepration between call and callback, a form of cooperative thread yielding on top of preemptive threads? If that isn't true for .NET, then I'd really interested to understand what else it is doing.
Re:Niklaus Wirth has died by pjmlp on Thursday January 04, 2024 @04:29AM (#38864979)
No, it is a state machine that generates an instace of a Task from Task Parallel Library, and automates the Run()/Get() invocations from it.

Assuming your type isn't an Awaitable, with magic methods to influence how the compiler actually generates the state machine.