Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^4: Do I need threads?

by BrowserUk (Patriarch)
on Dec 21, 2011 at 07:28 UTC ( [id://944551]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Do I need threads?
in thread Do I need threads?

Just replace delay.pl $_ with the call to your executable and you're good to go.

Not really.

You now have 10 processes appending concurrently to the same file. That will result in one unholy mess of not just interleaved lines from the different processes, but the first half of one line being finished with a line from a different process.

Yuck! Try reading that mess in and separating it back out.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^5: Do I need threads?
by TJPride (Pilgrim) on Dec 21, 2011 at 11:29 UTC
    Hmm, I suppose the script -could- send the output to separate files named according to process ID and then have the master recombine them before exiting. But I'll leave that up to the OP, who is probably capable of figuring that much out.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-03-19 06:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found