[Python-Dev] pthreads, fork, import, and execvp (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Tue May 16 23:13:29 CEST 2006
- Previous message: [Python-Dev] [Python-checkins] r46002 - in python/branches/release24-maint: Misc/ACKS Misc/NEWS Objects/unicodeobject.c
- Next message: [Python-Dev] pthreads, fork, import, and execvp
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Rotem Yaari wrote:
Rotem should simply avoid to fork() in the toplevel code of a module.
That's exactly the problem - the fork is not done at the module level, and the reason for the deadlock is imports inside functions performed by various library functions. This can happen virtually in every possible step of the program as long as the python builtins keep doing it.
Well, Python builtins (in the strict sense of the word) usually never directly import anything, and most of them not even indirectly import (there are some exceptions, of course, like the import builtin)
So if you are certain that the fork doesn't happen while an import is going, then I think the specific problem must be analyzed in more detail before an attempt is made to fix it.
Regards, Martin
- Previous message: [Python-Dev] [Python-checkins] r46002 - in python/branches/release24-maint: Misc/ACKS Misc/NEWS Objects/unicodeobject.c
- Next message: [Python-Dev] pthreads, fork, import, and execvp
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]