2 ms·
Structured concurrency looks a lot like C#'s Task library without the async/await sugar but with the exact same footguns. Joining into a synchronous function i
by jayd16 4y ago
Structured concurrency looks a lot like C#'s Task library without the async/await sugar but with the exact same footguns.
Joining into a synchronous function is an anti-pattern in C# because you consume threads. This seems to be the same, except with the assumption that virtual threads are fine.... But that's not an assumption that can be made by the method writer, right?
- pjmlp 4y agoTasks aren't threads in TPL.
- deleted 4y ago[deleted]
- jayd16 4y agoWhat are you trying to say? They still run on threads and can consume them.
- pjmlp 4y agoThey are no different from how Go routines or Java's virtual threads multiplex OS threads per execution path. In fact, if you feel like doing some advanced stuff, you can write your own schedule algorithm.
- deleted 4y ago[deleted]