Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: how do I create parrallel processing in this script?

by tirwhan (Abbot)
on Feb 05, 2010 at 10:35 UTC ( #821534=note: print w/ replies, xml ) Need Help??


in reply to Re^2: how do I create parrallel processing in this script?
in thread how do I create parrallel processing in this script?

Hmm. As I said above, there's not much point in doing this, because you almost certainly won't improve performance. However, if you did want to do this you could use one of the following methods:

- print to the output file from the children instead of the parent. You'll need to lock the output file in some way (see "perldoc -q lock" for some ways on doing that) so that the writes are not completely jumbled.

- use some form of Inter Process Communication to read the file content into the parent process. Read the documentation I linked to or search cpan for IPC for various ways of doing this.

- use threads and a shared variable instead of fork.


All dogma is stupid.


Comment on Re^3: how do I create parrallel processing in this script?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-12-26 03:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (164 votes), past polls