Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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
Node Status?
node history
Node Type: note [id://775905]
[stevieb]: choroba my GPS home device is done, at least prototype v1 is. I'm just making sure all of my code does what it says now
[stevieb]: I test/prototype code on my Pi, then I migrate it over to Arduino when it's ready (if that's a better platform for what I'm doing). The whole RPi stuff was for learning at first, then it snowballed. I'm just trying to get my in-house CI...
[stevieb]: ...done, which obviously requires a specific hardware setup.
[stevieb]: I don't write tests for the lower-level distributions (ie. ICs, sensors etc) within those distributions, I have all tests in a master distribution which encompasess all of the sub-modules

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2017-06-25 22:56 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (572 votes). Check out past polls.