[Python-bugs-list] [ python-Bugs-579116 ] pthread_exit missing in thread_pthread.h

SourceForge.net noreply at sourceforge.net
Thu Nov 6 09:55:03 EST 2003

Bugs item #579116, was opened at 2002-07-09 08:45
Message generated for change (Comment added) made by vpogrebi
You can respond by visiting: 

Category: Threads
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Pronath (micpro)
Assigned to: Nobody/Anonymous (nobody)
Summary: pthread_exit missing in thread_pthread.h

Initial Comment:

I'm using the Python 2.2.1 interpreter for scripting
language in a larger program. When I used the threading
module to create new threads, my main program did not
exit anymore, but hang, because one python thread
always remained.
It got much better when I inserted a call to
pthread_exit into do_PyThread_exit_thread

Patchfile is attached.


Comment By: Valeriy Pogrebitskiy (vpogrebi)
Date: 2003-11-06 09:55

Logged In: YES 

I'm using Python 2.2.1 (Unix) in a daemon process that starts 
child threads to handle specific events. I have noticed that 
occasionally (not all the time) child thread "stays" (in a 
SLEEPING) status after thread exits. When this happens, that 
thread never exits until entire process is stopped.

I have log files that have output coming from threading 
module (I have set threading._VERBOSE to 1) that show each 
thread's start and termination events. In addition, I use 
Queue module for inter-thread communication (when thread 
starts execution, it posts "START" message, and when it is 
about to exit its run() method, it posts "END" event).

So, from these logs and from output of "ps -fp <PID> -
o 'user,pid,ppid,pgid,time,stime,lwp,s'" I can see that some 
threads exit (which is indicated by _VERBOSE output and a 
message in a Queue), but still stay (in a SLEEPING state) in 
the process.

Does this behavior have something to do with the problem 
described in this report, or is it something different?

Is there patch (full instalation package) that fixes this 
problem (without me having to update source code and 
recompile the executable)?


Comment By: Neal Norwitz (nnorwitz)
Date: 2003-01-07 20:08

Logged In: YES 

Michael do you still have this problem with 2.2.2 or do you
still require this patch?


You can respond by visiting: 

More information about the Python-bugs-list mailing list