Conditions where it occurred / Performed steps:
Assume we have 2 threads creating a UniqueSystemId concurrently. Since all threads come from the same process, the first 32 bits are the same (PID).
Thread A starts and acquires the current nanosecond value nv.
Thread A is concurrently by Thread B.
Thread B acquires the same nanosecond value nv, updates the LAST_NANOSECONDS value with it, and creates a new UniqueSystemId.
Thread B creates another UniqueSystemId and updates the LAST_NANOSECONDS again.
Thread A continues, thinks that nv with its time stamp is unique since LAST_NANOSECONDS is not equal to nv and creates UniqueSystemId with the same value as Thread B did in step 3.
Required information
Conditions where it occurred / Performed steps: Assume we have 2 threads creating a
UniqueSystemId
concurrently. Since all threads come from the same process, the first 32 bits are the same (PID).nv
.nv,
updates theLAST_NANOSECONDS
value with it, and creates a newUniqueSystemId.
UniqueSystemId
and updates theLAST_NANOSECONDS
again.nv
with its time stamp is unique sinceLAST_NANOSECONDS
is not equal tonv
and createsUniqueSystemId
with the same value as Thread B did in step 3.