Message53439
Logged In: YES
user_id=21627
On (1): This is quite unfortunate, as I do think sys.exit
and thread.exit should do different things. There would be
approaches of further subclassing SystemExit; preserving the
property that raising SystemExit in a thread exits the
thread only - would such a solution be acceptable?
On (2): This is no different from raising SystemExit in the
main thread, which also does not invoke finally clauses in
other threads.
I don't think there can be a complete, reliable
implementation of thread cancellation, only a best-effort
approach. For POSIX, I'd suggest sending SIGUSR2 to each
thread through pthread_kill.
We might need to add a mechanism indicating whether a thread
is ready to be cancelled, similar to the POSIX cancellation
points. That would prevent the signal from arriving in an
arbitrary library function, and defer thread termination
until the library function completes. For blocking system
calls, sending signals would need to be activated
explicitly, to allow aborting them. |
|
Date |
User |
Action |
Args |
2007-08-23 16:01:58 | admin | link | issue502236 messages |
2007-08-23 16:01:58 | admin | create | |
|