A lightweight cooperative timeout mechanism for synchronous code `with timeout(seconds):`

Since your post is actually exactly the same that was proposed in another thread some days ago, I repeat my concerns:

You emphasize that the mechanism would be “cooperative”. But the details of the proposal reveal that it is cooperative only at the C level (like signal handling; so C extensions can be hardened), but it is not cooperative at the Python level (so Python code cannot be not be hardened). So, the following would also be true if a timeout has fired:

2 Likes