Working of fork join_none

In reply to dave_59:

Thanks. So as I understand, if it creates 5 parallel threads of $displays and 5 parallel threads of j=i, then all run at same simulation time, why only last value (5) is displayed and not the other ones? (kind of a race condition here?)

My another question here is j gets value of i at the same time the display statement gets executed, so ideally $display should show j as x. To simplify, let me add a code here.

module tb;
integer i,j;

initial
fork
i=5;
j=i;
$display(“value of j is %d”, j);
join_none
endmodule

Here, i=5, j=i and $display all get executed concurrently, and not sequentially. But output shows Value of j is 5. Now all the statements execute in active region, but I would have expected j as 5 if it was enclosed in begin…end. But why such behaviour in fork…join_none?