PyDocs

Nav

Concurrent Execution

BaseManager.start

  • BaseManager.start([initializer[, initargs]])
Spawn a server process for this manager object
1 Example
>>> with SharedMemoryManager() as smm:
...     sl = smm.ShareableList(range(2000))
...     # Divide the work among two processes, storing partial results in sl
...     p1 = Process(target=do_work, args=(sl, 0, 1000))
...     p2 = Process(target=do_work, args=(sl, 1000, 2000))
...     p1.start()
...     p2.start()  # A multiprocessing.Pool might be more efficient
...     p1.join()
...     p2.join()   # Wait for all work to complete in both processes
...     total_result = sum(sl)  # Consolidate the partial results now in sl
from the Python docs
See Also
No see-alsos for multiprocessing.managers/BaseManager.start
0 Notes
No notes for BaseManager.start