Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 51ba5b7d0c194b0c2b1e5d647e70e3538b8dde3e authored by Larry Hastings on 16 January 2017, 08:19:36 UTC
Version bump for Python 3.5.3.
Tip revision: 51ba5b7
mp_preload.py
import multiprocessing

multiprocessing.Lock()


def f():
    print("ok")


if __name__ == "__main__":
    ctx = multiprocessing.get_context("forkserver")
    modname = "test.mp_preload"
    # Make sure it's importable
    __import__(modname)
    ctx.set_forkserver_preload([modname])
    proc = ctx.Process(target=f)
    proc.start()
    proc.join()
back to top