Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Generate a unique ID

by LanX (Canon)
on Nov 15, 2010 at 13:20 UTC ( #871471=note: print w/ replies, xml ) Need Help??


in reply to Generate a unique ID

> I'm thinking to combine: process id with current date-time to the highest resoltion available. Is that enough?

If you're not absolutely sure if it's enough, then you should consider some dynamic error detecting mechanism.

For instance add a "sufficiently" long random number after a delimiter like underscore.

If ever the "head" part in front of the delimiter should be identical while the random "tail" part is different you can raise an error message. The length of the random part will decide about the probability to detect such a problem.

Of course I second Corions suggestion to add a host part in the ID-head.

Cheers Rolf


Comment on Re: Generate a unique ID
Re^2: Generate a unique ID
by BrowserUk (Pope) on Nov 16, 2010 at 08:21 UTC
    The length of the random part will decide about the probability to detect such a problem.

    Whilst you're right about the probability, the question still arises, do you try to detect the problem?

    Ie. Would you be happy with a sort utility that had the possibility to produce wrong results occasionally?

    If so, what probability would you accept?


    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.
      You missed the point:

      Detecting the existence of a problem gives you the chance to improve the algorithm that you expected to be perfect!

      Think about the recent problems with Rolls Royce jet engines in the Airbus A380. The redundancy of this airplane - it can still safely fly with only 2 of 4 engines working - helped discovering that this totally unexpected problem exists. Now the engineers can either try to improve those engines or Airbus can switch to another supplier.

      But without the redundancy they would have no clue now, why the airbus might have crashed.

      Absolute security is an illusion.

      Cheers Rolf

        But without the redundancy they would have no clue now, why the airbus might have crashed.
        Without the redundancy, they may not have had a failing engine. ;-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-12-26 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (165 votes), past polls