[Blog post] Cancellation in Julia 1.14

I made a blog post on the new cancellation feature in Julia 1.14, here:

The post describes what the cancellation system is for, how to use it, and how it works. Please let me know what you think! Especially let me know if I got something wrong.

Great read! Thanks for that! :smiley:

I found it very clearly written overall. I just noticed that I had 2 small points of confusion when reading.

The compiler reasonably assumes that no code that is :effect_free can cause the code to enter an illegal state.

Took me a while to parse. I think for me it would be easier to get with the negation in a different place.

Suggestion:
The compiler reasonably assumes that no code that is :effect_free can not cause the code to enter an illegal state.

Then, you can make a new token source, and pass its derived token to the child task:

And the example. I only got what you meant later on. In hindsight, the example is now clear to me. I think what confused me is that you talk about parent and child but in this example the parent lifetime is not so clear? Not sure.

Maybe for me a clearer demonstration would have been be to create 2 children coupled to the same source and explaining that this couples their lifetimes in the sense that both are cancled at the same time.

Thanks for the write up! I like how the implementation allows for cancellation inside of a @ccall. I’m guessing we are responsible for making sure that the external code is effect free? So if we declare it and a lock is taken somewhere, we could end up with a deadlock.