Re: [Python-de] Problem mit fork() in der C-API

31 Jan
2012
31 Jan
'12
2:11 p.m.
Christian Heimes lists@cheimes.de writes:
Wenn du selbst einen Fork machst, musst du auch die passenden Hooks verwenden. [..] http://docs.python.org/c-api/sys.html#PyOS_AfterFork
Zitat:
| Function to update some internal state after a process fork; this | should be called in the new process | if the Python interpreter will continue to be used. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | If a new executable is loaded into the new process, this function does | not need to be called.
Mein Code:
pid_t childpid = fork(); if (childpid == 0) exit(0);
Ich sehe nicht so direkt, warum der Python-Interpreter "will continue to be used" im neuen Thread ist.
Das ist schon mal ein Bug in deinem Code.
Warum?
4323
Age (days ago)
4323
Last active (days ago)
0 comments
1 participants
participants (1)
-
ole-usenet-spam@gmx.net