To start shmtimer
The UNIX
time()
function is a system call often called in
database servers. On multiprocessor systems, use of the
time()
function can be quite heavy. Even though a
process can run successively on different processors, this must be invisible to
the process. The process requires that each processor return the same time,
using
time()
. Therefore, the processors must synchronize their
internal clocks each and every time the
time()
function is called.
The
shmtimer program prevents this overhead.
shmtimer is a daemon process that writes the current
time in shared memory. The time is updated every second, which reduces the
number of calls of the
time()
function to a maximum of one per second.
When you initialize shared memory (shmmanager –i
), the
shmtimer program starts. If you remove shared memory,
shmmanager –k
, the
shmtimer stops first. In
shmtimer these options are available:
-
–i
: Initialize shmtimerA shmtimer program is started, and runs in the background.
-
–k
: Kill shmtimerThe running shmtimer program is killed. The allocated shared memory is cleared, but not removed.
-
–s
: Show status as stored in shared memory:- The current time
- The process ID of the running timer
-
–u
: Show information about shmtimer -
–v
: Show version and porting data of shmtimer
If
shmtimer stops, the shared memory is cleared, as
described for the
–k
option. From then on, the UNIX
time()
function is called, rather than reading the time
from shared memory.
If
shmtimer is killed,
shmtimer cannot clear its shared memory. Because
shmtimer is killed, the time in shared memory is never
updated, but the time is still read from shared memory. In that case,
shmtimer –s
returns a warning. You can start a new
shmtimer with
shmtimer –i
.