in reply to Re^2: using $SIG as an IPC interrupt?
in thread using $SIG as an IPC interrupt?

In theory threads are better for this since they both have the same data available and you just have to make sure synchronize access to the data.

In reality perl interpreter threads share only data you declare as shared. But that might be just right for your application. A second thread that sleeps until data arrives and then processes that data independently from the main thread. Or sets a shared variable which could be polled faster than a file descriptor, but that would have to be tested.

Also perl threads seem to have a bad reputation(??) but I might mix them up with the older threads before 5.6.

Replies are listed 'Best First'.
Re^4: using $SIG as an IPC interrupt?
by bobbob (Acolyte) on Aug 21, 2008 at 18:56 UTC
    Well, I have not had great results with threads in Perl, so that is part of my trepidation. Also, right now the loop calls itself using an ->after() directive, and its not clear to me if the child process could cancel the existing after counter one and immedately call the process. I would hate to go to this effort just to have the parent thread poll on a shared variable rather than a file, I'd like a true 'interrupt' type behaviour. Thanks!