Boost logo

Boost :

From: Lassi A. Tuura (lassi.tuura_at_[hidden])
Date: 2006-11-14 03:50:17


Hi,

> It seems from looking at the code that create_v4 will create
> identically the same guid if two computers (or nodes in a parallel
> computer) create a guid during the same second? This would be very
> common in any parallel program. This is why the paper you cite
> suggests using the MAC address of the computer for the lowest 6
> octets.

In case it helps the discussion, over the last year or so we've had
several reports of conflicting GUIDs generated independently in our
applications.

As far as I know all cases involved multiprocessor systems generating
GUIDs with MAC address. We never managed to trap this live but our
analysis indicates exactly the same piece of code executed exactly
the same millisecond on several processors and at least two managed
to generate the same 12 bits of randomness there are in GUIDs with
MAC address.[*]

Our GUID library (from ext2fs) uses /dev/urandom to generate the
random values, so it's pretty good; it's just that 12 bits of
randomness is not a lot and a millisecond is a long time these days.

In light of this, I would recommend using fully random GUIDs by
default. Otherwise there is a very real probability of generating
the same GUID several times.

Lassi

[*] Our best guess was that all the processes got synchronised
through a system level lock such as accessing a file on NFS, which
then acted as a barrier and released all processes to the GUID-
generating code exactly the same time.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk