| 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 | # |
| 11 | # Copyright (c) 2006-2008, R Oudkerk |
| 12 | # Licensed to PSF under a Contributor Agreement. |
| 13 | # |
| 14 | |
| 15 | import sys |
| 16 | from . import context |
| 17 | |
| 18 | # |
| 19 | # Copy stuff from default context |
| 20 | # |
| 21 | |
| 22 | __all__ = [x for x in dir(context._default_context) if not x.startswith('_')] |
| 23 | globals().update((name, getattr(context._default_context, name)) for name in __all__) |
| 24 | |
| 25 | # |
| 26 | # XXX These should not really be documented or public. |
| 27 | # |
| 28 | |
| 29 | SUBDEBUG = 5 |
| 30 | SUBWARNING = 25 |
| 31 | |
| 32 | # |
| 33 | # Alias for main module -- will be reset by bootstrapping child processes |
| 34 | # |
| 35 | |
| 36 | if '__main__' in sys.modules: |
| 37 | sys.modules['__mp_main__'] = sys.modules['__main__'] |