[Zope3-dev] randid()

Jeremy Hylton jeremy@zope.com
Fri, 22 Mar 2002 18:39:53 -0500 (EST)


Tim and I were talking about the randid() function yesterday
afternoon.  It seems to have two serious problems if it's used for
generated unique ids:

    - It's subject to the birthday paradox.  We should expect to see a
      duplicate after 2**16 calls.

    - It's not in the least bit thread safe.  Two threads executing in
      parallel could get the same sequence of random ids.

Is there any reason we can't replace its use in ObjectHub with a
simple persistence counter?

Jeremy