Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Parallel::ForkManager and vars from the parent script - are they accessible? (or do I need inter process communication?)

by clinton (Priest)
on Aug 08, 2007 at 18:23 UTC ( [id://631364]=note: print w/replies, xml ) Need Help??


in reply to Parallel::ForkManager and vars from the parent script - are they accessible? (or do I need inter process communication?)

Because forks are separate processes (as opposed to threads), they cannot access each other's variables, so you will need some scheme to communicate between them.

The most appropriate communication scheme depends on how you want to use the data. It may involve opening pipes to communicate between the processes (see IPC::Open2) or access to shared memory space (eg IPC::MMap), or maybe communicating via a file or database, or even signals.

Note, I haven't used any of these modules, so your milage may vary. But search CPAN for IPC, and read perlipc for ideas.

Clint

  • Comment on Re: Parallel::ForkManager and vars from the parent script - are they accessible? (or do I need inter process communication?)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-24 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found