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(parent) threads will execute after all the threads(child threads) in the fork_join is executed In fork_join_any the main(parent) threads executes if any one of the child threads excecutes In fork_join_none child threads and main(parent) threads are executed parallely
fork-join  fork_join_any fork-join_none

2.Can we use wait_fork in fork_join ?

We know that in fork_join the main thread is executed only when all the threads in fork_join is executed so here no need of using wait_fork. We can use wait fork after the fork_join_any or fork_join_none statement to wait for all the threads in the fork-join_any or fork_join_none to complete. So here in fork_join wait_fork is not required.

3.Difference between Blocking and Non-Blocking Assignments ?

blocking Non-Blocking
In Blocking Assignment one statement is executed then the next statement will executed i.e first expression of right hand side is evaluated and immediately assigned to the left hand side variable In Non-Blocking assignment evaluated all the right hand side expression for the current time unit and assigned to left-hand side variable at the end of the time unit
Represented by " = " Represented by " <= "
It executes sequentially It executes parallely
Blocking is used in combinational Non-Blocking is used in sequential
b image

Clone this wiki locally