Benjamin Peterson | e711caf | 2008-06-11 16:44:04 +0000 | [diff] [blame] | 1 | # |
| 2 | # Package analogous to 'threading.py' but using processes |
| 3 | # |
| 4 | # multiprocessing/__init__.py |
| 5 | # |
| 6 | # This package is intended to duplicate the functionality (and much of |
| 7 | # the API) of threading.py but uses processes instead of threads. A |
| 8 | # subpackage 'multiprocessing.dummy' has the same API but is a simple |
| 9 | # wrapper for 'threading'. |
| 10 | # |
Benjamin Peterson | e711caf | 2008-06-11 16:44:04 +0000 | [diff] [blame] | 11 | # Copyright (c) 2006-2008, R Oudkerk |
Richard Oudkerk | 3e268aa | 2012-04-30 12:13:55 +0100 | [diff] [blame] | 12 | # Licensed to PSF under a Contributor Agreement. |
Benjamin Peterson | e711caf | 2008-06-11 16:44:04 +0000 | [diff] [blame] | 13 | # |
| 14 | |
Benjamin Peterson | e711caf | 2008-06-11 16:44:04 +0000 | [diff] [blame] | 15 | import sys |
Richard Oudkerk | b1694cf | 2013-10-16 16:41:56 +0100 | [diff] [blame] | 16 | from . import context |
Benjamin Peterson | e711caf | 2008-06-11 16:44:04 +0000 | [diff] [blame] | 17 | |
Richard Oudkerk | b1694cf | 2013-10-16 16:41:56 +0100 | [diff] [blame] | 18 | # |
| 19 | # Copy stuff from default context |
| 20 | # |
| 21 | |
| 22 | globals().update((name, getattr(context._default_context, name)) |
| 23 | for name in context._default_context.__all__) |
| 24 | __all__ = context._default_context.__all__ |
Richard Oudkerk | 84ed9a6 | 2013-08-14 15:35:41 +0100 | [diff] [blame] | 25 | |
| 26 | # |
| 27 | # XXX These should not really be documented or public. |
| 28 | # |
| 29 | |
| 30 | SUBDEBUG = 5 |
| 31 | SUBWARNING = 25 |
Benjamin Peterson | e711caf | 2008-06-11 16:44:04 +0000 | [diff] [blame] | 32 | |
| 33 | # |
Richard Oudkerk | 5046e97 | 2012-10-08 13:07:00 +0100 | [diff] [blame] | 34 | # Alias for main module -- will be reset by bootstrapping child processes |
| 35 | # |
| 36 | |
| 37 | if '__main__' in sys.modules: |
| 38 | sys.modules['__mp_main__'] = sys.modules['__main__'] |