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.
Created on 2012年10月16日 12:16 by ethan.furman, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg173033 - (view) | Author: Ethan Furman (ethan.furman) * (Python committer) | Date: 2012年10月16日 12:16 | |
On Windows multiprocessing has a well known limitation: because there is no fork() new shells must be invoked, and if the call that ultimately starts multiprocessing is not guarded by an `if __name__ == '__main___'` check an infinite loops results and you have a very nice brick instead of a computer. On Stackoverflow I proposed a work-around [1], which is basically to check if an environment variable exists (MP_GUARD is this case), and if it does raise an exception. I'm going to try and merge that into multiprocessing itself. Are there any other platforms besides Windows where this is a problem? [1] http://stackoverflow.com/q/12852643/208880 |
|||
| msg173040 - (view) | Author: Tim Golden (tim.golden) * (Python committer) | Date: 2012年10月16日 13:07 | |
The natural way to do this in windows is using the Job API: http://msdn.microsoft.com/en-us/library/windows/desktop/ms684161%28v=vs.85%29.aspx However I'm not sure where to apply this within the multiprocessing architecture (or if it's even a good idea). |
|||
| msg173043 - (view) | Author: Richard Oudkerk (sbt) * (Python committer) | Date: 2012年10月16日 14:11 | |
I think this is a duplicate of Issue #15646 which has been fixed in the 2.7 and 3.x branches. If you run Lib/test/mp_fork_bomb.py you should get a RuntimeError with a helpful message telling you to use the 'if __name__ == "__main__"' idiom. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:37 | admin | set | github: 60450 |
| 2013年02月14日 17:57:35 | sbt | set | status: pending -> closed |
| 2012年10月16日 14:11:04 | sbt | set | status: open -> pending superseder: multiprocessing can do equivalent of a fork bomb on Windows messages: + msg173043 resolution: duplicate stage: resolved |
| 2012年10月16日 13:07:01 | tim.golden | set | nosy:
+ tim.golden messages: + msg173040 |
| 2012年10月16日 13:02:26 | r.david.murray | set | nosy:
+ sbt type: behavior versions: + Python 3.4, - Python 3.1 |
| 2012年10月16日 12:16:57 | ethan.furman | create | |