4 ms·
I've always been Mr Sustrik's fan, but this has a special place in my heart. I highly recommend reading the "What is structured concurrency?" section with unde
by majke 5y ago
I've always been Mr Sustrik's fan, but this has a special place in my heart.
I highly recommend reading the "What is structured concurrency?" section with understanding. I think this is a big deal.
Why?
Let's start from another angle. Have you ever seen `pthread_cancel` manpage? Or "POSIX.1 Cancellation points"? This is an utter mess!
More than that, _any_ framework I've seen that allows to "kill" a coroutine (goroutine, thread, actor) in the end reproduces this "pthread_cancel" drama.
Basically, thread cancellation seems to be an unsolved computer science problem.
Mr Sustrik in "structured concurrency" makes one easy assumption, which in practice is sensible. It's not academic proposal. It's totally useable. The programmer must understand it and use it properly, but this is a totally workable constraint - that is:
- the thread must exit before its parent dies.
This small thing seems to be making all the differnce.
Anyhow. If you ever wondered why killing threads is a mess, libdill proposes a solution.
- ibraheemdev 5y ago> I highly recommend reading the "What is structured concurrency?" section with understanding. I think this is a big deal. The idea was originally introduced and explained in more depth here: https://250bpm.com/blog:71/ https://250bpm.com/blog:71/
- hnedeotes 5y agoWhat do you mean by "pthread_cancel" drama and being an unsolved computer science problem?