Crash in thread on program termination

E

Eric Ries

I just recently came across this post from the mailing list:

http://mail.python.org/pipermail/python-list/2005-February/265569.html

in which the error with daemon threads at interpreter shutdown is discussed.
I have experienced this problem in numerous programs that I've written and
wanted to write in with a solution. I don't know if this has already been
discussed elsewhere, but I could not find it. Bug #75444 is marked fixed,
but the discussion attached to the bug leaves me unclear as to whether the
bug has been fixed or if simply there are fewer places where it can happen
now. So I'm offering the fix that has worked for me (in python 2.3) on the
off-chance that it is useful. If not, please feel free to disregard.

Attached you'll find my modified copy of python 2.3's threading.py - it is
mostly unmodified except for a few blocks which have been moved around.
Where possible, I have attempted to have functions bind currentThread and
other module globals into their own local namespace. I probably didn't catch
every case where this happens, but it works well enough for me.

Thanks,

Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top