Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Everything gets output twice

by clintp (Curate)
on May 21, 2001 at 18:00 UTC ( [id://81966]=note: print w/replies, xml ) Need Help??


in reply to Everything gets output twice

Since there's no code here, can I ask a silly question? Is there a fork() anywhere in your code?

Replies are listed 'Best First'.
Re: Re: Everything gets output twice
by jepri (Parson) on May 21, 2001 at 18:48 UTC
    Absolutely no forks, and I put that random number check in just to make sure of that (in case Apache was forking twice or something). In case of a fork the random number generator would be called twice, and would return two different random numebrs.

    It really is looking like something is copying STDERR and returning it about a second later.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

      Actually, the most common problem with doubled output and fork is when the stdio buffers are copied by the fork. In that case, you'd get the same number as the call to rand would have happened before the fork.

      Also, fork duplicates the whole process including the current seed used by rand, so even if the fork happened before the call to rand, you'd get the same number in both processes unless you managed to get Perl's implicit use of srand to happen after the fork.

              - tye (but my friends call me "Tye")

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found