Execution of order

I know there is another thread with the same name, but actually this is a different question.

When a process processes several times, is parent termination in front of children done? On the contrary? Simultaneously?

Here is an example. Suppose I have a for loop that produces 1 parent process for 4 children. At the end of the for loop, I want the parent process to pass some data to the children through the channels. Data is written to each child process "corresponding stdin".

Will the parent send the data first before any of them executes their code? This is important because we do not want it to start working with an invalid stdin.

+4
source share
3

. (IPC), . . , , () . FIFO . wait() .

+6

, ? ? ? -

.

pipe

. , .

, , . , .

/

.

+1

. .

Look at mutexes or other ways to work with concurrency.

0
source

Source: https://habr.com/ru/post/1656143/


All Articles