Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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

by sgt (Deacon)
on Nov 19, 2008 at 20:54 UTC ( #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?

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

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (5)
    As of 2023-03-24 19:41 GMT
    Find Nodes?
      Voting Booth?
      Which type of climate do you prefer to live in?

      Results (61 votes). Check out past polls.