zlacker

[return to "The Downsides of Go's Goroutines"]
1. keving+F7[view] [source] 2023-12-31 06:49:44
>>djha-s+(OP)
Externally canceling a task at a location other than a known stopping point is used as an example here, but in most environments doing this is a known-bad design decision, since the terminated thread-or-task might have been holding a mutex, and now that mutex is stuck closed forever. .NET has been closing the door on this primitive for years (https://learn.microsoft.com/en-us/dotnet/core/compatibility/...)
◧◩
2. jayd16+7b[view] [source] 2023-12-31 07:55:41
>>keving+F7
It's not so much that exceptions are bad though. Cancellation tokens throwing is not obsolete. Mutex and such can be cleaned up in finally blocks in .NET. It's just that being able to place the exception in a predictable place has benefits.
[go to top]