MCPcopy Index your code
hub / github.com/python/cpython / run_in_child

Method run_in_child

Lib/test/_test_multiprocessing.py:5762–5774  ·  view source on GitHub ↗
(cls, start_method)

Source from the content-addressed store, hash-verified

5760
5761 @classmethod
5762 def run_in_child(cls, start_method):
5763 import json
5764 mp = multiprocessing.get_context(start_method)
5765 r, w = mp.Pipe(duplex=False)
5766 p = mp.Process(target=cls.run_in_grandchild, args=(w,))
5767 with warnings.catch_warnings(category=DeprecationWarning):
5768 p.start()
5769 grandchild_flags = r.recv()
5770 p.join()
5771 r.close()
5772 w.close()
5773 flags = (tuple(sys.flags), grandchild_flags)
5774 print(json.dumps(flags))
5775
5776 def test_flags(self):
5777 import json

Callers

nothing calls this directly

Calls 8

PipeMethod · 0.80
get_contextMethod · 0.45
ProcessMethod · 0.45
startMethod · 0.45
recvMethod · 0.45
joinMethod · 0.45
closeMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected