Understanding random stability in multiple-thread system

Hi,

I’m trying to understand the risk of the following code in terms of random stability (assuming it affects the case reproducibility using same seed).


foearch(thread[i])
fork
//some operation unrealted to x[i]
 begin
  x[i]=$urandom();
 end
//some operation which takes value from x[i]
join_none
wait_fork;

As I understand that the $urandom call takes value from thread RNG. Will this produce the same results if run multiple times using the same seed?

Thanks.

In reply to possible:

Section 18.14.2 Thread stability in the IEEE 1800-2017 SystemVerilog LRM basically says that threads get seeded by their parent thread in order of appearance, not execution order.

The only risk here is that iteration over index [i] must have a consistent ordering. That’s true when the index type is integral, but not when it is a class type.