3 ms·
One thing I haven't seen any blogs write about is that multiprocessing in 3.8.x uses `spawn()` and not `fork()`[0] on MacOS. Granted, most applications are not
by css 6y ago
One thing I haven't seen any blogs write about is that multiprocessing in 3.8.x uses `spawn()` and not `fork()`[0] on MacOS. Granted, most applications are not running on OS X Server, but an update that changes a low level API like that led to some issues where running code locally will fail when running it remotely will work. The following code will run anywhere except on MacOS on 3.8.x, where it crashes with `_pickle.PicklingError` as it tries to resolve the name `func` that is not in the new stack:
import multiprocessing
some_data = {1: "one", 2: "two"}
func = lambda: some_data.get(2)
process = multiprocessing.Process(target=func)
process.start()
[0]: https://bugs.python.org/issue33725 https://bugs.python.org/issue33725
- jamestimmins 6y agoI'm in the process of adding 3.8 support to Airflow. This was the first (but not the last) obstacle in doing so.