Write code to execute task A in parallel 10 times, and call task B only after task A has finished executing 10 times

In reply to ben@SystemVerilog.us:

Hi Ben, thanks for your answer. But how would I truly know if all the 10 iterations executed in parallel at the same time? I ask this because since the task is called inside an initial block which takes a simulation time of 0, wouldn’t all 10 iterations complete in time 0 irrespective of the fork join_none?

I also noticed that the output of the second code you sent is:

# sent t()
# j 10 k 9 
# Task A. Time = 0, i = 9
# j 10 k 8 
# Task A. Time = 0, i = 8
# j 10 k 7 
# Task A. Time = 0, i = 7
# j 10 k 6 
# Task A. Time = 0, i = 6
# j 10 k 5 
# Task A. Time = 0, i = 5
# j 10 k 4 
# Task A. Time = 0, i = 4
# j 10 k 3 
# Task A. Time = 0, i = 3
# j 10 k 2 
# Task A. Time = 0, i = 2
# j 10 k 1 
# Task A. Time = 0, i = 1
# j 10 k 0 
# Task A. Time = 0, i = 0
# done=1111111111
# Task B. Time = 0, i = 0
# exit

Can you please explain why the values of i are 9 down to 0 when the loop is incrementing in an ascending fashion? Also, why is i = 0 when task B is called even I though I pass the argument = 2?