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

前端 未结 6 887
梦如初夏
梦如初夏 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

    To wait until a process has completed its work and exited, use the join() method.

    and

    Note It is important to join() the process after terminating it in order to give the background machinery time to update the status of the object to reflect the termination.

    This is a good example helped me understand it: here

    One thing I noticed personally was my main process paused until the child had finished its process using the join() method which defeated the point of me using multiprocessing.Process() in the first place.

提交回复
热议问题