lock a process onto a specific processor
lockpid -l cpu pid
lockpid -u pid
lockpid is a utility which allows a process to be run
entirely on a specified processor. This can be used if performance
can be improved by restricting certain applications to specific
processors. A process cannot be locked to a processor that has been
root permission is required to run lockpid.
To assign a process to a processor lockpid requires both
the CPU number, the base processor being CPU1,
and the process identifier.
The process identifier or PID can be found using
or by running the process in the background.
The options are as follows:
The -u option has no effect if a locked process
has finished executing or terminates abnormally.
-l cpu pid
locks process pid to the processor given by cpu
where both cpu and pid are integer values
unlocks the previously locked process pid
lockpid exits with 0 upon successful completion.
It exits with 1 if an error occurs.
locked on cpu num
Confirmation that process process_id was locked to processor
Confirmation that the process process_id has been unlocked
from the processor.
lockpid: invalid CPU specified
The argument specifying a processor must be numeric.
lockpid: invalid pid specified
The argument specifying a process id must be numeric.
lockpid: cannot specify negative CPU
The argument specifying a processor must be a positive integer.
lockpid: CPU specified exceeds number of CPUs installed
The specified processor does not exist or has not been serialized.
lockpid: cannot lock pid process_id
The process process_id could not be locked to the specified
processor. This can occur if the process has already used floating
point different from that used by the processor specified.
lockpid: cannot unlock pid process_id
The process process_id could not be unlocked.
lockpid: can't open device
The required device node device is missing. Run
to recreate any missing device nodes.
lockpid: cannot determine number of processors
The kernel cannot determine the number of processors installed and
lockpid: malloc for procdata failed
lockpid could not malloc required memory
for its internal work area.
lockpid: cannot determine processor_data
lockpid could not read the relevant processor data from the kernel
Using the PID returned as a result of running a process in
the background, lockpid is used, in the following example,
to lock process 22852 to CPU2:
cpusar -Q -P2 1 1
lockpid -l 2 22852
cpusar -Q -P2 1 1
Note the following warnings:
lockpid is not part of any currently supported
standard; it is an extension of AT&T System V provided by
the Santa Cruz Operation, Inc.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003