Last active
December 17, 2015 01:59
-
-
Save mrkmg/5532468 to your computer and use it in GitHub Desktop.
PHP5 snippit to lower threads niceness and then kill the thread when finished.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
proc_nice(19); //Lowers niceness | |
set_time_limit(0); //Removes timelimit of script | |
/**** | |
... | |
Do some very intensive task you do not want to bog down your server | |
... | |
****/ | |
posix_kill( getmypid(), 28 ); //Kill current thread | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment