PHP MySql - 如何确定进程的优先级

I have a little more than hundred php scripts running on my server right now. Each one of them run loops and insert data into my db. I did that in order to learn killing processes in mysql. So to kill them, I coded a php file that loops through the processlist and kill them one by one. The problem is that this script is not executed. It keeps loading in my browser (no errors...). Also do note that I can't manually launch a show processlist in mysql, as mysql is totally overloaded at the moment, and nothing is responding. So what I guess is that my 'killing process' script is the last one on the queue and will only be executed at the end. So my question is to know if there is a way to force a process in mysql and put it at priority number one. Thank you in advance for your replies. Cheers. Marc

This is how I am killing the processes:

$qry = mysql_query("SHOW FULL PROCESSLIST");
while ($row=mysql_fetch_array($qry)) {
  $process_id=$row["Id"];
    $sql="KILL $process_id";
    mysql_query($sql);

}

I'm not sure if this will actually affect MySQL, but on Unix/Linux, you could try calling proc_nice() near the top of your script with a negative increment (like -20). It basically does the same thing as the nice command.

From the Wikipedia page on nice:

"... nice is used to invoke a utility or shell script with a particular priority, thus giving the process more or less CPU time than other processes. A niceness of −20 is the highest priority and 19 or 20 is the lowest priority. The default niceness for processes is inherited from its parent process, usually 0."