Process Management Intrinsics [ DCE for the HP 3000 ] MPE/iX 5.0 Express III Documentation
DCE for the HP 3000
Process Management Intrinsics
Process management (threads related) features of intrinsics are listed
here. For detailed information about the intrinsics, refer to the MPE/iX
Intrinsics Reference Manual (32650-90013).
PROCINFO The PROCINFO intrinsic returns threads related
information to the caller. Four item numbers do
this:
* Item#=13 (threaded task option (I32)) -
returns an integer that can have one of the
following values:
0 This task was never multi-threaded
during its life-span.
1 This PIN was multi-threaded at some
point during its existence (for
example, it was created by the RUN
command or CREATEPROCESS intrinsic and
has executed at least one PTHREAD
intrinsic.
2 The task is currently multi-threaded.
The user must have PM capability.
* Item#=14 (thread type option (I32)) -
returns an integer that can have the
following values:
0 This PIN was never multi-threaded.
1 The PIN passed is that of the initial
thread (for example, a process created
by the RUN command or CREATEPROCESS
intrinsic that has executed at least
one PTHREAD intrinsic).
2 The PIN passed is that of a secondary
thread of the task.
The user must have PM capability.
* Item#=15 (number of threads option (I32)) -
returns an integer that can have the
following values:
0 This PIN was never multi-threaded
during its life-span.
1 This PIN was multi-threaded at some
point during its existence (for
example, it was created by the RUN
command or CREATEPROCESS intrinsic and
has executed at least one PTHREAD
intrinsic.
n This PIN is part of a threaded task and
n is the number of threads currently
associated with the task.
The user must have PM capability.
* Item#=16 (list of thread PINs option (16-bit
signed integer array)) - the user must pass
in an array large enough to hold the PINs of
all threads associated with the task. The
first element of the array must contain the
array size; PROCINFO fills the array
starting from the second element. If the
array size is not large enough, PROCINFO
fills the available space and returns an
error indicating that the array size was
insufficient. The last element of the array
will be a zero. The user must have PM
capability.
SUSPEND and ACTIVATE If a thread invokes SUSPEND (or ACTIVATE) only that
thread is is suspended. Other restrictions for
suspending a thread are:
* Child waits - A thread is only be permitted
to wait for the children it created. An
attempt to wait on a child created by
another thread results in an error.
* Father waits - Only the initial thread can
issue a father wait. An error is returned
to secondary threads issuing a father wait.
FATHER All threads have the same father, namely the father
of the initial thread. If a secondary thread
creates a child process, the father of the child
process is the initial thread of the task.
GETPRIORITY A threaded process can change its own priority.
However, an initial thread or a secondary thread
cannot have its priority changed by another
process.
GETPROCINFO This works the same with any threaded process.
KILL The children of a task can only be killed by the
initial thread. A KILL issued by a secondary
thread returns an error indicating that the thread
is not the father of the child.
PROCTIME This routine returns the CPU time that the thread
has accumulated.
SENDMAIL and An error is returned under the following
RECEIVEMAIL conditions:
* If called from a secondary thread.
* If calling SENDMAIL and sending to a child
that is a secondary thread.
* If calling RECEIVEMAIL and receiving from a
child that is a secondary thread.
* If calling SENDMAIL and sending to the
father and the father is a thread (either
initial or secondary).
* If calling RECEIVEMAIL and receiving from
the father and the father is a thread
(either initial or secondary).
TERMINATE and QUIT If a thread calls TERMINATE or QUIT, the task,
including all of its threads, is terminated.
MPE/iX 5.0 Express III Documentation