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

Re: Question about Parallel::ForkManager

by ikegami (Pope)
on Sep 30, 2011 at 21:31 UTC ( #928927=note: print w/replies, xml ) Need Help??

in reply to Question about Parallel::ForkManager

There are 1+@urls copies of @ar. You want to change @ar in the parent, which isn't something the children can do directly. The easiest wat is to use the mechanism described in the "RETRIEVING DATASTRUCTURES from child processes" section of the documentation.
  • Comment on Re: Question about Parallel::ForkManager

Replies are listed 'Best First'.
Re^2: Question about Parallel::ForkManager
by vit (Friar) on Sep 30, 2011 at 21:46 UTC
    So there is no way to avoid disk memory usage?
    It's not good in terms of performance. But also since I may have many calls from clients on the server will not they race for the same tmp file?
    Also, say if the process is interrupted by some reason in the middle the tmp file will never be removed.

      I didn't realized it used the disk. Pipes could be used, so I'm curious why it uses the disk. (Ah yes, using pipes would prevent the parent from doing other work while the children are running. This is usually not a problem, but it would break P::FM's interface to support this.)

      There won't be a race condition. It surely defends against that using the process id in the file name.

        Maybe I can do something simple with "fork" and pipes? If you have a solution could you give it to me.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://928927]
[stevieb]: Torturing one of my dev RPis to turn four 5v stepper motors at the same time (via Parallel:: ForkManager for 50k degrees (a whole lot of full turns!). Let's see if it burns out or not.
[stevieb]: My GPIO expander chips should arrive tomorrow, but I think I'll throw a shift register against them and see if all six I have will turn at once. Amps are near the breaking point, but I want to know max sustainable V and I output.

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2018-03-22 22:16 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (286 votes). Check out past polls.