Skip to content

Processes InterviewQuestions

Bhavanasandrala edited this page Sep 13, 2022 · 15 revisions

1.Difference between fork_join,fork_join_any and fork_join_none ?

fork_join fork_join_any fok_join_none
In fork_join the main threads will execute after all the threads in the fork_join is executed In fork_join_any the main threads executes if any one of the child threads excecutes In fork_join_none child threads and main threads are executed parallely
fork-join  fork_join_any fork-join_none

2.Can we use wait_fork in fork_join ?

We know that the main thread is executed only when all the threads in fork_join is executed so here no need of using wait_fork. But you can use fork - join_none or join_any, then you can use wait fork after the join_join_any or fork_join_none statement to wait for all the threads in the fork-join_any or fork_join_none to complete.

Clone this wiki locally