Performance Tips
DIL performance improvements for the Series 800 fall into two categories:
those that keep your process from waiting for resources, and those that actually
improve your I/O performance. The first three of the tips described below fall
into the first category; the last two are in the second category.
Process Locking
Normally, the operating system swaps processes in and out of memory; you can
circumvent this swapping by using the plock system call.
If you are running as the super-user (or have the
PRIV _MLOCK
capability),
you can use plock to lock your process in memory; plock prevents the system
from swapping out the process's code, data, or both.
The following example illustrates its use:
#include <sys/lock.h>
int plockO;
mainO {
plock(PROCLOCK); /* lock text and data segments into memory */
plock(UNLOCK);
/* unlock the process */
}
Refer to plock(2) and getpri vgrp (2) in the HP- UX Reference for more
information.
Setting Real-Time Priority
The operating system schedules processes based on their priority. Under
normal circumstances, the priority of a process drops over time, allowing newer
processes a greater share of CPU time. You can assign a higher priority to
your process and keep its priority from dropping by using the rtprio system
call.
If you are running as the super-user (or have the
PRIV _RTPRIO
capability),
you can use rtprio to give your process a real-time priority. Real-time
8-12
Series
800
Dependencies