Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^5: Generate a unique ID

by Your Mother (Canon)
on Nov 17, 2010 at 15:32 UTC ( #872005=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Generate a unique ID
in thread Generate a unique ID

I'm curious about the why/which in this. I just ran you test code several times and even put it to 1e9 and 1e8 which both ran out of memory before completing and I got no "Repeat" deaths. This is on a modern Linux box with Perl 5.8. What hardware/perl combination makes yours bomb out so early?


Comment on Re^5: Generate a unique ID
Re^6: Generate a unique ID
by BrowserUk (Pope) on Nov 17, 2010 at 15:37 UTC

    I did mention the reason. MS' CRT rand() function uses 15-bits only.

    This also affects Perl directly because the perl's rand is implemented in terms of the crt function.

    I'd normally use Math::Random::MT for anything where I need a descent random, but the standard implementation (and therefore the Perl module) is not threadsafe due to some static internal buffers.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2014-09-23 02:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (210 votes), past polls