What exactly is Python multiprocessing Module's .join() Method Doing?

前端 未结 6 890
梦如初夏
梦如初夏 2020-11-29 16:09

Learning about Python Multiprocessing (from a PMOTW article) and would love some clarification on what exactly the join() method is doing.

In an old tut

6条回答
  •  死守一世寂寞
    2020-11-29 16:53

    Without the join(), the main process can complete before the child process does. I'm not sure under what circumstances that leads to zombieism.

    The main purpose of join() is to ensure that a child process has completed before the main process does anything that depends on the work of the child process.

    The etymology of join() is that it's the opposite of fork, which is the common term in Unix-family operating systems for creating child processes. A single process "forks" into several, then "joins" back into one.

提交回复
热议问题