Support "asynchronous exceptions"
A function at risk of "naive misuse", it is only accessible via the C API. This commit adds basic support for it using the same mechanism we use for signals. We also have the GIL-check mechanism, but that would be a bit more work to get working right now due to the fact that our GIL-checks don't support throwing exceptions. Doing the async-exc check during signal checking means that we will throw the async exc faster than CPython does. It also means that there are some pathological cases where with a lot of threads and a lot of async excs we will probably have much worse performance. But as long as they are rare I think this commit shouldn't add any steady-state performance costs.
Showing
test/tests/async_exc.py
0 → 100644
Please register or sign in to comment