in reply to Re: shuffle in Parallel::ForkManager;
in thread shuffle in Parallel::ForkManager;
$ perl -E' rand; my $pid = fork; srand if $ARGV[0]; say rand; waitpid($pid, 0); ' 0 0.458778299481736 0.458778299481736 $ perl -E' rand; my $pid = fork; srand if $ARGV[0]; say rand; waitpid($pid, 0); ' 1 0.656664192517386 0.153404296449484
(The seed is determined the first time rand is called, so the problem only manifests itself if rand is called before fork.)
|
|---|