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.
In reply to Re^2: Is it OK for Time::HiRes::time() to report the time differently per thread?
by ikegami
in thread Is it OK for Time::HiRes::time() to report the time differently per thread?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |