Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by Anonymous Monk
on Apr 23, 2026 at 13:03 UTC ( [id://11167610]=note: print w/replies, xml ) Need Help??


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

Sorry, looks like replacing time() with clock_gettime(CLOCK_MONOTONIC) fixes the issue. Should have googled better first. I forgot to say, there's supposed to be another synchronised section in place of the 2nd "printf", hence my concern.

Replies are listed 'Best First'.
Re^2: Is it OK for Time::HiRes::time() to report the time differently per thread?
by ikegami (Patriarch) on Apr 23, 2026 at 16:26 UTC

    That doesn't fix your bug. The race condition is still present even if you didn't see a failure.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11167610]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2026-05-08 11:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.