Sets the priority class of a process¶
Sets the priority class of a process
Version >= 6.0.3
set_process_priority(server_name, process_handle, priority_class)
Changes the priority class of the specified process. The priority_class value is one of the PROCESS_PRIORITY defines in sculptor.h. These are equivalent to the priority classes in the Windows API but are not the values used in that API. The priority will only be changed if the process effecting the change has appropriate permissions. It will normally be possible for a process to change its own priority and that of its children. The real time priority should almost never be used. It is intended for use by drivers and very short duration programs that must respond immediately. Administrator privilege may be needed to set the priority class of a process not started by the calling program.
If server_name is NULL, sets the priority class of the specified local process.
If process_handle is 0, sets the priority class of the named Sculptor server.
If server_name is NULL and process_handle is 0, sets the priority class of the calling program.
Returns 0 if successful or -1 if an error occurs.
The flags argument to the execute() command can be used to set the initial priority of a process on Windows but its values are not the same as the priority codes defined here. See the EXEC flags in /Sculptor/include/sculptor.h.
To set the server priority class:
set_process_priority(tmp.ServerName, 0, tmp.NewServerProcessPriority)