Multiprocessing process does not join when putting complex dictionary in return queue

后端 未结 1 672
情话喂你
情话喂你 2021-01-14 15:46

Given a pretty standard read/write multithreaded process with a read Queue and a write Queue:

8 times worker done is printed, but the join() statement i

1条回答
  •  太阳男子
    2021-01-14 15:53

    I think I have pieced this together from two sources as I always have the same problem. I think the important thing is that this is in Windows.

    Note from the documentation

    Since Windows lacks os.fork() it has a few extra restrictions:

    Then read the answers here that join() is for forked processed.

    I have always managed to run multiprocessing in a similar fashion to you without using join() and not seen any errors - I'm more than happy for a counterexample to explain why it's needed. Indeed, removing it has corrected your issue.

    And this article goes into more depth about the differences with child processes in multiprocessing between operating systems. I do think that the issue with join(), specifically, should be more explicit in the documentation.

    0 讨论(0)
提交回复
热议问题