Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Generate a unique ID

by GrandFather (Sage)
on Nov 15, 2010 at 10:58 UTC ( #871444=note: print w/replies, xml ) Need Help??

in reply to Generate a unique ID

It's probably not relevant, but we have seen time "run backwards" on multi-core systems using AMD processors. Such unusual events have the ability to play hob with any scheme that expects monotonically increasing time and can be surprisingly difficult to debug - some things do happen "once in a blue moon".

We've only seen this happen at micro-second time scales so I doubt very much it is a concern for your application, but it could be if the same technique were used to generate ids across threads.

True laziness is hard work

Replies are listed 'Best First'.
Re^2: Generate a unique ID
by BrowserUk (Pope) on Nov 15, 2010 at 12:13 UTC
    It's probably not relevant, but we have seen time "run backwards" on multi-core systems using AMD processors.

    Was this using Time::HiRes on a Windows system? If so, I know how that can happen, and I don't think it is constrained to AMD processors, though I seem to remember seeing that Intel have addressed the underlying problem on their latest chips.

    For my purposes, I'll be probably be using a time value limited to milliseconds anyway, but thanks for the heads up.

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      It was actually in a C++ application using the high res 'multi media' timer (IIRC) in an application trying to sync clocks on external hardware. The information we found on the web implicated just AMD processors and was consistent with our observations, albeit with a fairly small sample set. I wasn't directly involved with the problem so I don't remember the details, but it was within the last two months and the computers involved were probably less than a year old.

      True laziness is hard work

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://871444]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2018-06-20 06:50 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.