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.