Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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

by perrin (Chancellor)
on Jun 30, 2009 at 04:47 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2023-02-06 12:16 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (34 votes). Check out past polls.