Carl Banks <pavlovevide...@gmail.com> writes: > Which is "communicating with the rest of the program periodically". > > Presumably you have to protect objects to share them? There you go: > anytime you try to acquire a lock have the thread check to see whether > to abort.
Normally, acquiring a lock doesn't require running code in other threads, at least in the uncontended case. If you have to switch threads twice in order to acquire a lock, your implementation could use some improvement. -- http://mail.python.org/mailman/listinfo/python-list