This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pthread_exit missing in thread_pthread.h
Type: Stage:
Components: Interpreter Core Versions: Python 2.2
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: facundobatista, micpro, nnorwitz, vpogrebi
Priority: normal Keywords:

Created on 2002-07-09 13:45 by micpro, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python2.2.1.patch micpro, 2002-07-09 13:45 Patch for thread_pthread.h
Messages (5)
msg11517 - (view) Author: Michael Pronath (micpro) Date: 2002-07-09 13:45
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
(thread_pthread.h).

Patchfile is attached.
msg11518 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-01-08 01:08
Logged In: YES 
user_id=33168

Michael do you still have this problem with 2.2.2 or do you
still require this patch?
msg11519 - (view) Author: Valeriy Pogrebitskiy (vpogrebi) Date: 2003-11-06 14:55
Logged In: YES 
user_id=902722

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)?
msg11520 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2004-12-01 02:11
Logged In: YES 
user_id=752496

Please, could you verify if this problem persists in Python 2.3.4
or 2.4?

If yes, in which version? Can you provide a test case?

If the problem is solved, from which version?

Note that if you fail to answer in one month, I'll close this bug
as "Won't fix".

Thank you! 

.    Facundo
msg11521 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2005-03-22 22:07
Logged In: YES 
user_id=752496

Deprecated. Reopen only if still happens in 2.3 or newer. 

.    Facundo
History
Date User Action Args
2022-04-10 16:05:29adminsetgithub: 36869
2002-07-09 13:45:26micprocreate