The VTIMER feature is responsible for all functions pertaining to measurement and timing of thread execution. It exports a number of functions that are used typically by higher-level operating system subsystems, such as, UNIX.
VTIMER functions include thread accounting (threadTimes(2K)) and virtual timeouts (svVirtualTimeoutSet(2K) and svVirtualTimeoutCancel(2K)). A virtual timeout handler is entered as soon as the designated thread or threads have consumed the specified amount of execution time. Virtual timeouts can be set either on individual threads, for support of subsystem-level virtual timers (for example, SVR4, setitimer, VIRTUAL, and PROF timers), or on entire actors, for support of process CPU limits.
A virtual timeout handler is entered as soon as one or more designated threads have consumed the specified amount of execution time.
Execution time accounting can be limited to execution in the thread's home actor (internal execution time), or can include cross-actor invocations such as system calls (total execution time).
The svThreadVirtualTimeout() and svThreadActorTimeout() handlers are invoked at thread level and thus can use any API service, including blocking system calls. Timeout events are delivered to application threads, such as threadAbort(), that is, a thread executes a virtual time handler on its own behalf.
For details about virtual time, see the VTIMER(5FEA) man page
The virtual time API is summarized in the following table:
Function |
Description |
---|---|
svActorVirtualTimeoutCancel() |
Cancel an actor virtual timeout |
svActorVirtualTimeoutSet() |
Set an actor virtual timeout |
svThreadVirtualTimeoutCancel() |
Cancel a thread virtual timeout |
svThreadVirtualTimeoutSet() |
Set a thread virtual timeout |
svVirtualTimeoutCancel() |
Cancel a virtual timeout |
svVirtualTimeoutSet() |
Set a virtual timeout |
threadTimes() |
Get thread execution times |
virtualTimeGetRes() |
Get virtual time resolution |