User Tools

Site Tools


uphp:functions:setpriority

This is an old revision of the document!


setpriority($val)

This can be used to run a script with a higher priority if required. If the $val > 0, it will wait till all other scripts are finished before continuing, so that the maximum amount of memory is available to the script.

This will also set the max_concurrent_scripts to 1 to prevent other scripts from starting while this is set, so make sure to unset the priority by passing a 0 value once you have done your critical processing.

Example:

<?
// some code
setpriority(1); 
// this will now run exclusively
...
setpriority(0); // back to default priority
 
?>
uphp/functions/setpriority.1494914809.txt.gz · Last modified: 2021/09/13 05:56 (external edit)