N
N
nathanael2019-07-25 18:22:29
Python
nathanael, 2019-07-25 18:22:29

How to make subprocesses wait for join right after start in python?

I need to process a certain array of data:
{ item1: [str, str, str], item2: ... , ... }
Before passing to the values ​​in item2, the algorithm must process and save the data where it should be, and only then proceed to processing data in item2.
In each thread, str is just processed.
I think that I have a race and before the join is executed, the algorithm runs away to item2.
How is it guaranteed to make the entire group of child threads wait for join (which, as I understand it, is needed to make the algorithm in the parent process wait for the child processes to complete)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-07-25
@sergey-gornostaev

Use some kind of synchronization primitive. barrier, for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question