Fork...join_none

Can anyone explain the below output for given code?

module top;
  
  initial begin
    for(int i = 0; i < 10; i++) begin
      fork
        $display("i=%0d",i);
      join_none
      
    end
  end
  
endmodule

Output:

Compiler version P-2019.06-1; Runtime version P-2019.06-1; Nov 2 22:12 2020
i=10
i=10
i=10
i=10
i=10
i=10
i=10
i=10
i=10
i=10

In reply to DhavalP:

https://verificationacademy.com/forums/systemverilog/fork-joinnone-inside-loop#reply-38644

you need to introduce the automatic variable

In reply to DhavalP:

fork join_none will make sure that the internal threads will be scheduled and will be executed later. By the time, it comes out of for loop and executes the internal threads, the value of the variable i will be 10 only. The use of automatic variables will help you in this case.

Hope this helps.
Putta Satish
Maven Silicon Softech Pvt. Ltd.