Query related to automatic task in class

In reply to mukul1996:

You are confusing the lifetime of a task with the static class qualifier.A task declared as a class method always has an automatic lifetime. The static class qualifier on a class method has nothing to do with its lifetime. It does make a difference on class variables. It determines if the class member is associated with the class type, or an instance of a class object. It is unfortunate that the same keyword gets used for slightly different meanings.

Your module check_task_2 does not create any class objects. There is no race condition because each call to A_T. has a separate instance of the automatic variable p. If instead you had defined the class as

class A;
  static int b;
  task A_T(int p);
   b = p;
  endtask
endclass

Now there is only once instance of the static variable b. It gets instanciated as part of the class type and does not depend on class A ever being constructed.