News for hackers. Stuff that matters.
Re:.NET 5.0 by spaetzleesser on Tuesday November 10, 2020 @01:57PM (#25049813)
Agreed. Async is nice on the server but on the desktop it’s a real problem. For a while they had both sync and async but now it’s often only async.

I just finished an app that had to shutdown while some async operations were still not finished. Really hard to manage compared to using threads.

Re:.NET 5.0 by lukevp on Tuesday November 10, 2020 @02:37PM (#25050638)
How is Task.WaitAll different from Thread.Joining a bunch of threads? Or if you were cancelling tasks, using cancellation tokens?
Re:.NET 5.0 by hansvm on Tuesday November 10, 2020 @03:25PM (#25051402)
The other comment alluded to this, but the crux of the problem is that you can schedule a task to run and wait on the completion of that task, but the only available thread for it to run is the one currently waiting for it to complete. The writeup here isn't bad: https://devblogs.microsoft.com/pfxteam/await-and-ui-and-dead...
Re:.NET 5.0 by cm2187 on Tuesday November 10, 2020 @02:50PM (#25050854)
If you are running Task.WaitAll on a UI thread you are likely to create a deadlock.
Re:.NET 5.0 by zmj on Tuesday November 10, 2020 @05:35PM (#25052990)
The move to async trades one set of problems for another. Yes, implementing cooperative cancellation is tricky. On the other hand, recovering from corrupted state caused by Thread.Abort is also tricky.