Automatic task in Fork join_none


module tb;
  initial begin
      $display ("[%0t] Main Thread: Fork join going to start", $time);
    fork
          print (20, "Thread1_0");
          print (30, "Thread1_1");
          print (10, "Thread2");
    join_none
      $display ("[%0t] Main Thread: Fork join has finished", $time);
  end

  // Note that this is not an automatic task, its static
  task print (int _time, string t_name); // here this  task should be automatic to operate properly
    #(_time) $display ("[%0t] %s", $time, t_name);
  endtask
endmodule


idont know why when we remove the automatic " making the task static" affect the functionality of the code
the output in case of static will be like this
[0] Main Thread: Fork join going to start
[0] Main Thread: Fork join has finished
[10] Thread2
[20] Thread2
[30] Thread2

why the static type affect the string value passed to the task and doesn’t affect the int time variable passed

i didn’t understand the code provider explanation
Without automatic keyword, the same display task with different string tags will produce the same display message. This is because multiple threads call the same task and share the same variable in tool simulation memory. In order for different threads to initiate different copies of the same task, automatic keyword has to be used.

In reply to le_NOIRE2000:

Theoretically the _time variable could be overwritten, but in your example it does not get overwritten before the delay control executes. (one the process gets suspended for a certainly delay, the delay variable is no longer looked at).

In reply to dave_59:

In reply to le_NOIRE2000:
Theoretically the _time variable could be overwritten, but in your example it does not get overwritten before the delay control executes. (one the process gets suspended for a certainly delay, the delay variable is no longer looked at).

Thanks Dave,

iam still struggling at understand the concept of the static tasks , i know that each variable inside the scope of the static task will be also static which means at each invocation it will keep its value , does this concept applied at the arguments passed “string t_name in our above example” to the static task
like it will keep the first value when we call it for the first time , then at any future call it will neglect the arguments passed ?