Re:Libdill: Structured Concurrency for C (2016)
by ibraheemdev on Tuesday June 01, 2021 @03:37PM
(#27360125)
> 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/
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.