Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Parent/Child,Boss/Worker->IPC suggestions

by perrin (Chancellor)
on Jun 30, 2009 at 04:47 UTC ( [id://775905]=note: print w/replies, xml ) Need Help??


in reply to Parent/Child,Boss/Worker->IPC suggestions

I had good luck using Parallel::ForkManager and keeping shared state in a SQL database. I considered many other designs because the idea of polling the db bothered me, but ultimately this one was simpler to code and more scalable than anything else I came up with.

However... Isn't gearman supposed to do this for you? Why don't you make the jobs that you want to pass off to the workers into gearman jobs?

  • Comment on Re: Parent/Child,Boss/Worker->IPC suggestions

Replies are listed 'Best First'.
Re^2: Parent/Child,Boss/Worker->IPC suggestions
by josh803316 (Beadle) on Jun 30, 2009 at 07:34 UTC
    Yes, my original design was to have gearman do this for me but the problem I've been facing is shared memory, communication between parent and child workers and blocking during a long running gearman worker process....
    I wasn't sure how to create a manager/worker setup, all on the gearman worker side. I guess I could have the manager be a gearman worker and a gearman client at the same time. (Thoughts??).

      Yeah, I advise you not to use shared memory. I'd keep state in a database, and use signals if you need to interrupt running processes to shut them down.
Re^2: Parent/Child,Boss/Worker->IPC suggestions
by metaperl (Curate) on Jun 30, 2009 at 14:05 UTC
    I second shared state in a SQL(ite)? database. I tried a ton of IPC::* modules and couldnt get any of them to work. I also tried <CODE>Cache</CODE to no avail.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-25 18:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found