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.
◧◩◪
3. bb88+ac[view] [source] 2023-12-31 08:18:13
>>jayd16+7b
Python/C++ has finally: blocks as well.

They're not nearly as good as the `with` statement (or context handler) in python.

◧◩◪◨
4. jayd16+Lc[view] [source] 2023-12-31 08:33:52
>>bb88+ac
I mentioned .NET in response to the parent and the context of the CancellationToken class. What is the relevance of your comment?
◧◩◪◨⬒
5. bb88+Fd[view] [source] 2023-12-31 08:47:53
>>jayd16+Lc
What's the point of continuing discussion if all you understand is .NET?
[go to top]