Fork-join_none with delay

In reply to SanjanaDhiran:

It should display:
0#####
1#####
1
2#####
2
3

Explanation:
Below Sequence will be followed-

  1. “0#####” will be executed first
  2. It will execute blocking statement #1
  3. Fork will be spawned but will not start
  4. “1#####” - will Execute the Display statement
  5. “1” - The Blocking statement has been executed it will execute the first spawn “1”
  6. “2#####” Will execute the display statement
  7. “2” - Blocking statement has been executed and will execute the next thread
  8. “3” All statements have been executed and will come out of the loop and display remaining

Thanks
Irshad