Think about Loose Coupling | |
PerlMonks |
Re^4: Perl Alarm Not Workingby aceofspace (Acolyte) |
on Dec 20, 2010 at 03:39 UTC ( [id://877938]=note: print w/replies, xml ) | Need Help?? |
You have something there that MySql is immune to SIGALRM.
Here's another test script I wrote to test SIGALRM in a script running MySql:
Above script basically do a search for the number of matches of $keywords in $websites_table. I've used a timeout of 5 seconds( $timeout = 5;) to limit the time of search, i.e. exit if search takes more than 5 seconds. When it timeouts by the eval{} block, it will indicate how much time the script has ran as shown by the variable $time_ran in the if($@) loop. But I'm getting funny results when it timeout. It overshoots the timeout limit of 5 sec condiderably. In one instance, I got a value of $time_ran = 18. How do I fix this problem?
In Section
Seekers of Perl Wisdom
|
|