Return the current multiprocessing context.
()
| 131 | |
| 132 | |
| 133 | def get_context(): |
| 134 | """Return the current multiprocessing context.""" |
| 135 | # fork context does fork()-without-exec(), which can lead to deadlocks, |
| 136 | # so default to "spawn". |
| 137 | context_name = config.get("multiprocessing.context", "spawn") |
| 138 | if sys.platform == "win32": |
| 139 | if context_name != "spawn": |
| 140 | # Only spawn is supported on Win32, can't change it: |
| 141 | warn(_CONTEXT_UNSUPPORTED, UserWarning) |
| 142 | return multiprocessing |
| 143 | else: |
| 144 | return multiprocessing.get_context(context_name) |
| 145 | |
| 146 | |
| 147 | def get( |
searching dependent graphs…