DCE for the HP e3000 (B3821-90002)
Programming Notes
Threads Architecture
Chapter 4
43
All threads are created as siblings. The threads of a task all have the same father task;
namely, the father of the initial thread. If a thread creates a child using creatprocess,
that child is the child of the task, not of the thread. From the tasks child-point-of-view,
its father is the initial thread. When a thread exits, the children and the threads it
created are not terminated.
Threads do not “own” the child processes they create. However, threads may find it
necessary to wait for the termination of the offspring that they created. Therefore, a
thread is permitted to wait for a specific child to terminate and is permitted to wait on
the termination of any child. Refer to the suspend and activate intrinsics for more
explanation.
While threads are implemented with multiple processes, to the end user threads should
appear to coexist within a single process. Process management hides the MPE/iX
implementation of threads from the programmer. The process handling intrinsics work
on a task basis.
Development, Debugging, and Application Execution of Threads
This section discusses the development, debugging, and execution of applications that
use threads on MPE/iX. It should be read before attempting to create or run an
application that uses threads.
Debug has the following features to facilitate debugging in a threaded environment:
• Breakpoints
• Commands
• Environmental Variable
Breakpoints.
There are three types of breakpoints available when debugging a threaded program:
Breakpoint Type Description
Task-Wide Breakpoints that are recognized by any thread
within a task.
Thread-Specific Breakpoints that are identical to pin-specific
breakpoints,but are thread-private, and are specified
using an enhanced syntax.
Stop-All-Threads Breakpoints with this option, when encountered by a
thread within a threaded task suspend all other
threads within the task until a CONTINUE command
is issued.
The syntax for the address and pin parameters to breakpoint commands includes the
specification:
logaddr [:pin|:@]
and the following for threads:
logaddr [:[[init_thread_pin].tin |.@][:@]]
where tin is the thread number returned by pthread_create. The pin number of the
initial thread can be obtained using SHOWPROC. The syntax [init_thread_pin].tin specifies a
thread, [init_thread_pin].@ specifies a task-wide breakpoint, and :@ following a