"Marcin 'Qrczak' Kowalczyk" <[EMAIL PROTECTED]> wrote:
> "tomer filiba" <[EMAIL PROTECTED]> writes:
> 
> > once a thread is created, there is no way to kill it *externally*.
> > which is a pity, since the thread must be "willing" to die,
> 
> Doing that unconditionally is impractical: the thread has no way
> to protect itself from being killed at moments it has invariants of
> shared data temporarily violated.
> 
> I agree that it should not require continuous checking for a
> thread-local "ask to terminate" flag spread into all potentially
> long-running loops, i.e. it requires a language mechanism. But it
> must be temporarily blockable and catchable.
> 
> Here is how I think the design should look like:
> http://www.cs.ioc.ee/tfp-icfp-gpce05/tfp-proc/06num.pdf

I did not read all of that paper, but it seems to rely on the
(un)masking of signals in threads, as well as the sending of signals to
'kill' a thread.  One problem is that Windows doesn't really allow the
sending/recieving of any non-process-killing signals, so it would be a
platform-specific feature.

If you want a sample implementation of that kind of thing, SAGE 
(http://modular.math.washington.edu/sage/) performs signal
masking/unmasking to stop the execution of underlying computation
threads.

 - Josiah

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to