Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: fork(), IO::Socket::SSL and rand()

by sgt (Deacon)
on Nov 19, 2008 at 20:54 UTC ( [id://724722]=note: print w/replies, xml ) Need Help??


in reply to Re^2: fork(), IO::Socket::SSL and rand()
in thread fork(), IO::Socket::SSL and rand()

Just feeling that somehow ikegami's answer could be better phrased:

There are three points:

  • (added by me) calling srand() implicitly or explicitly with no seed should seed the way perl seeds (at least as the doc says for a perl version superior to 5.004)
  • then 'perldoc -f srand' says explicitly that one should not call srand() twice as you would lose randomness, so it seems that reseeding in each child is not the better option (one implicit call from use IO::Socket::SSL and one explicit call from each child)
  • finally actually delaying the implicit and only call to srand() can be done requiring IO::Socket::SSL in each child </it>

    IMHO this was the point made by fletch and at least another monk.

    cheers --stephan update: sorry not second post just answer
    • Comment on Re^3: fork(), IO::Socket::SSL and rand()
  • Log In?
    Username:
    Password:

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

    How do I use this?Last hourOther CB clients
    Other Users?
    Others musing on the Monastery: (3)
    As of 2024-04-20 08:55 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found