Regarding Race Condition

In reply to hemaja:
A race condition occurs when two or more threads are using the same resources. There are many examples of race conditions. A few are listed below.

  1. The same signal is driven and sampled at the same time.
    => To avoid this race condition, a clocking block in interface is used as it provides an input and output skews to sample and drive, respectively.
  2. Race condition between testbench and design.
    => The program block is used to avoid this race, as module executes on an active region, while program block executes in reactive region.
  3. Race condition in event.
    => This race condition occurs when one thread is waiting for triggering an event using @(event) syntax and at the same time event is triggered from another thread. This race condition could be avoided by using wait statement and triggered method like wait(event.triggered);

Please refer clocking block, program block, SV regions and events for more details.