multi-core-python icon indicating copy to clipboard operation
multi-core-python copied to clipboard

what's the story on error handling and cancellation?

Open ckp95 opened this issue 2 years ago • 0 comments

Hi, I came here after watching the Pycon 2023 talk about this. Hope this isn't the wrong place to ask. I want to understand how this approach to concurrency deals with error handling and cancellation.

Let's say I write code using subinterpreters as the concurrency mechanism, rather than threads or processes or async.

  • I start in the "parent" interpreter, and create a subinterpreter. The subinterpreter runs into an unhandled exception. Will it be propagated seamlessly back up to the parent interpreter? How do you catch it?
  • Conversely, can the parent interpreter throw an exception into a sub-interpreter, like how you can .throw into a coroutine? i.e. can subinterpreters be cancelled easily like async tasks (and unlike threads)?

ckp95 avatar Jun 15 '23 21:06 ckp95