On Tue, Jul 28, 2009 at 12:52 AM, Jan Kaliszewski <z...@chopin.edu.pl> wrote:

> As I wrote, you must use signals. Though sometimes it's a good idea
> to combine these two techniques (i.e. signal handlers call sys.exit(),
> then sys.exitfunc/or function registered with atexit does the actual
> cleaning actions).


Another way of combining signals and atexit functions is to write a signal
handlers which update some QUIT_APP flag, which the application polls on
occasionally. This way you'll avoid deadlocks which may happen if you have a
multi-threaded application, and your main thread had just acquired a lock.

--doron
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to