[Python-Dev] threads duplicated on fork() prevent child from terminating properly (original) (raw)

Jack Jansen Jack.Jansen@cwi.nl
Sun, 29 Jun 2003 23:22:08 +0200


On zondag, jun 29, 2003, at 23:12 Europe/Amsterdam, L.C. (Laurentiu C. Badea) wrote:

The simple program below launches a thread, then fork()s and attempts to clean the mess up on exit like the nice process it is. Only problem is, the child does not want to die, looks like it detached and is sitting on scheduletimeout() (according to ps).

I haven't looked at it in detail, but this could well be a problem. And if it is then it may need a different solution as your suggestion (clean up the mess in os.fork()), as fork() could conceivably be called from extension modules. Hmm, no, these should be good citizens and call PyOS_AfterFork(), I guess.

Anyway: you should submit a bug report for this so it doesn't get lost.