Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Generate a unique ID

by GrandFather (Cardinal)
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


Comment on Re: Generate a unique ID
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2014-12-26 22:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls