Re: isolating thread-unsafe modules

2013-07-30 Thread David Cantrell
On Sun, Jul 28, 2013 at 10:02:25PM +0100, Bob MacCallum wrote: Good question - I have always hacked something with fork in the past but it just seemed so simple with Thread::Queue and threads. I've never needed much IPC in the past. Parallel::ForkManager has some (evil, hacky*) support for

Re: isolating thread-unsafe modules

2013-07-30 Thread DAVID HODGKINSON
On 30 Jul 2013, at 14:54, David Cantrell da...@cantrell.org.uk wrote: On Sun, Jul 28, 2013 at 10:02:25PM +0100, Bob MacCallum wrote: Good question - I have always hacked something with fork in the past but it just seemed so simple with Thread::Queue and threads. I've never needed much IPC

Re: isolating thread-unsafe modules

2013-07-30 Thread David Cantrell
On 30/07/2013 20:38, DAVID HODGKINSON wrote: On 30 Jul 2013, at 14:54, David Cantrell da...@cantrell.org.uk wrote: Parallel::ForkManager has some (evil, hacky*) support for returning data from a forked child to the parent. And I've used it. Works fine. So have I, to work around an

Re: isolating thread-unsafe modules

2013-07-29 Thread Ashley Hindmarsh
Message: 3 Date: Sun, 28 Jul 2013 20:07:59 +0100 From: Bob MacCallum uncool...@gmail.com Subject: isolating thread-unsafe modules To: London.pm Perl M[ou]ngers london.pm@london.pm.org Message-ID: cafliikdbkm62+wr79hyrs8h-ser0e+qgivj1nahx48stky0...@mail.gmail.com Content-Type

Re: isolating thread-unsafe modules

2013-07-29 Thread Bob MacCallum
2013 20:07:59 +0100 From: Bob MacCallum uncool...@gmail.com Subject: isolating thread-unsafe modules To: London.pm Perl M[ou]ngers london.pm@london.pm.org Message-ID: cafliikdbkm62+wr79hyrs8h-ser0e+qgivj1nahx48stky0...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1

isolating thread-unsafe modules

2013-07-28 Thread Bob MacCallum
Sorry for the Perl question, but I'm a bit out of my depth... I have a Dancer app providing a web service, and I have another script using the same Dancer config file and db schema (e.g. use Dancer qw/:script/). This script watches the database (for changes made by the web app) and does the

Re: isolating thread-unsafe modules

2013-07-28 Thread Dave Hodgkinson
Threads? Now you have two problems. Why not processes? Sent from my iPhone On 28 Jul 2013, at 20:07, Bob MacCallum uncool...@gmail.com wrote: Sorry for the Perl question, but I'm a bit out of my depth... I have a Dancer app providing a web service, and I have another script using the same

Re: isolating thread-unsafe modules

2013-07-28 Thread Dominic Humphries
Some people, when confronted with a problem, think, I know, I'll use threads, and then two they hav erpoblesms On 28 July 2013 21:13:52 Dave Hodgkinson daveh...@gmail.com wrote: Threads? Now you have two problems. Why not processes? Sent from my iPhone On 28 Jul 2013, at 20:07, Bob

Re: isolating thread-unsafe modules

2013-07-28 Thread Bob MacCallum
Good question - I have always hacked something with fork in the past but it just seemed so simple with Thread::Queue and threads. I've never needed much IPC in the past. It looks like this could be a better option:

Re: isolating thread-unsafe modules

2013-07-28 Thread Bob MacCallum
Parallel::ForkManager seems to do the trick. On Sun, Jul 28, 2013 at 10:02 PM, Bob MacCallum uncool...@gmail.com wrote: Good question - I have always hacked something with fork in the past but it just seemed so simple with Thread::Queue and threads. I've never needed much IPC in the past.