in reply to Re: Is it OK for Time::HiRes::time() to report the time differently per thread?
in thread Is it OK for Time::HiRes::time() to report the time differently per thread?

I think the output is consistent. For each thread id, the first output is before the next output.

That's not what the OP wants. The OP want to bar the threads from proceeding to obtaining the "next" time only after every thread has reached that point.

However, the implementation of the barrier is flawed. A race condition exists.

  • Comment on Re^2: Is it OK for Time::HiRes::time() to report the time differently per thread?