metafor has asked for the wisdom of the Perl Monks concerning the following question:
I am attempting to minimize processor use by having a program (which I plan on spawning off as a thread) sleep for 1 hour and wake to do a check of various RSS feeds.
I would like to be able to terminate this thread (either from another program or another thread from the same process) cleanly -- that is, I don't wanna just kill the process ID.
Is there a way to wake a perl program that's sleeping from another thread or another program? I know it's supposed to wake up when you send it SIGALRM but the perl documentation says that some systems may use alarms for sleep and that it's dangerous.
Also, is there another, cleaner, preferred method to accomplish such a task other than using sleep? I'm basically trying to write a background daemon that runs but that I can cleanly tell to exit.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Waking threads that do periodic checks
by BrowserUk (Patriarch) on Sep 25, 2011 at 06:17 UTC | |
Re: Waking threads that do periodic checks
by ikegami (Patriarch) on Sep 25, 2011 at 05:21 UTC | |
Re: Waking threads that do periodic checks
by Khen1950fx (Canon) on Sep 26, 2011 at 04:29 UTC | |
by BrowserUk (Patriarch) on Sep 26, 2011 at 04:57 UTC |
Back to
Seekers of Perl Wisdom