Re: Concurrent access to /dev/urandom

From: David Lang (dlang_at_digitalinsight.com)
Date: 12/09/04

  • Next message: Adrian Bunk: "IDE: strange WAIT_READY dependency on APM"
    Date:	Wed, 8 Dec 2004 19:10:16 -0800 (PST)
    To: Bernard Normier <bernard@zeroc.com>
    
    

    On Tue, 7 Dec 2004, Bernard Normier wrote:

    > I am just trying to generate UUIDs (without duplicates, obviously).
    >

    pulling data from /dev/random or /dev/urandom will not ensure that you
    don't have duplicates.

    the key factor in a random number generator is that the next number to
    coem out must be (sufficiantly) unpredictable. this says nothing about it
    being unique, in fact it says that if you pull the number 1234 the first
    time you should have the exact same odds of pulling 1234 the second time
    as you have in pulling 4321 (or any other number)

    no much of the time you can get away with useing a random number generator
    like this, but if you pull enough numbers you will get collisions.

    remember the birthday paradox. it says that if you get a group of 26
    people in a room you have about a 50% chance that two of these people have
    the same birthday.

    now that's only with numbers in the range of 1-365 if you pull 16 bit
    numbers (1-65536) you will need a much larger group to see the problem,
    but if you pull enough you WILL see the problem eventually.

    David Lang

    -- 
    There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.
      -- C.A.R. Hoare
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Adrian Bunk: "IDE: strange WAIT_READY dependency on APM"

    Relevant Pages

    • Re: Kernel SCM saga..
      ... On Thu, 7 Apr 2005, Martin Pool wrote: ... pull the patches from the BK2CVS server. ... And the other way is to make it so complicated that there are no obvious deficiencies. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: generator question
      ... How do you start this generator? ... It's a "pull" starter. ... adding a propane system greatly reduced the cost of our LQ ...
      (rec.equestrian)
    • Re: Tuning Amps
      ... Lord Valve wrote: ... in Cherry stinking up the next room. ... Gets clickier when you pull more drawbars, ... to go from an 80s clean generator with no hum, ...
      (alt.guitar.amps)
    • Re: Tuning Amps
      ... Lord Valve wrote: ... in Cherry stinking up the next room. ... Gets clickier when you pull more drawbars, ... to go from an 80s clean generator with no hum, ...
      (alt.guitar.amps)
    • Re: Tuning Amps
      ... The multiple contact system is used in the New B-3, ... The keyclick generation system in the XK works great, ... Gets clickier when you pull more drawbars, ... to go from an 80s clean generator with no hum, ...
      (alt.guitar.amps)

    Loading