Multitasking Functions

An application program using CMS has at its command facilities to:
  • Manage multiple threads of execution
  • Handle asynchronous conditions
  • Coordinate the execution of concurrent computation.
These facilities can be grouped into several broad areas of services:
  • Process Management

    These services provide for the creation, deletion and control of threads. They are the fundamental services for creating a multitasking application.

  • Event Management

    The complex tasks of handling asynchronous events and signaling conditions are handled by these services. These functions provide a means for defining events, signaling their occurrence, and taking action in response to the events.

  • Interprocess Communication

    This set of functions provides for communication between the threads of a process and between different processes by means of message queues. A powerful feature of these communication functions is that the same functions are used for communication within one virtual machine and between virtual machines anywhere in a network.

  • Synchronization

    Threads can serialize access to shared data and coordinate activity through these functions. They provide support for structured synchronization techniques and for basic locking.

  • Multiprocessor Configuration Control

    CMS allows an application to harness the power of a multiprocessor complex by means of the CP virtual multiprocessor capability. While the application need not be sensitive to virtual multiprocessing, it can request from CMS that additional virtual CPU's be added to its virtual machine.

  • Timer Services

    These services provide threads the capability to set and manipulate timers. Threads can wait for a time interval to expire, test to see if it has expired, or be asynchronously signaled on timer expiration.

  • Accounting Services

    These services allow the application to account for resource use. They include the capability to group accounting information to correlate resource use with some other user on whose behalf service is being performed.

  • Abend Services

    These services allow the application to request its own abnormal termination and provide for general abend recovery.

  • Trace Services

    The tracing services provide for the collection of diagnostic trace information. Tracing for CMS and for the application is provided, as well as the capability to capture trace events as they happen.

The following table lists all the multitasking functions and their use. For more information on specific functions see CMS Multitasking Function Descriptions.

Table 1. Multitasking Functions
Function Use
AbnormalEnd Abnormally terminates a process
AccountControl Defines and queries accounting attributes
AccountIdentify Defines an accounting entity
CondVarCreate Creates a condition variable
CondVarDelete Deletes a condition variable
CondVarGetHandle Gets the handle of a condition variable
CondVarSignal Signals a condition variable
CondVarWait Waits on a condition variable
DateTimeGet Queries the time and date
DateTimeSubtract Computes differences of times and performs time format and zone conversions
EventCreate Creates an event definition
EventDelete Deletes an event definition
EventDiscard Inhibits further propagation of signals
EventEnable Enables or disables for specific events
EventModify Modifies an event definition
EventMonitorCreate Defines an event handling environment
EventMonitorDelete Deletes an event handling environment
EventMonitorEnable Enables or disables specific monitors
EventMonitorQuery Gets information about an event monitor
EventMonitorReset Resets the state of an event monitor
EventMonitorSelect Starts or stops monitoring by specific monitors
EventQuery Gets information about an event definition
EventQueryAll Gets all event names and monitor tokens
EventRetrieve Gets data accompanying the occurrence of an event
EventSelect Enables or disables for specific events
EventSignal Signals the occurrence of an event
EventTest Tests for the occurrence of events
EventTrap Defines or deletes an asynchronous handler for events
EventWait Waits for the occurrence of events
MonitorBufferCreate Gets the address of the CMS monitor data area
MutexAcquire Gets a mutex
MutexCreate Creates a mutex
MutexDelete Deletes a mutex
MutexGetHandle Gets the handle of a mutex
MutexRelease Releases a mutex
ProcessCheckPoint Takes a snapshot of the process state
ProcessGetID Gets the ID of a process
ProcessQueryBlocked Finds blocked threads
ProcessQuerySuspended Finds suspended threads
QueueClose Closes a queue
QueueCreate Creates a queue
QueueDelete Deletes a queue
QueueIdentifyCarrier Identifies an interprocess communication carrier
QueueIdentifyService Identifies a service queue
QueueOpen Opens a queue
QueueQuery Queries the count of messages waiting
QueueReceiveBlock Receives a message from a queue (blocking)
QueueReceiveImmed Receives a message from a queue (nonblocking)
QueueReply Replies to a message
QueueSend Sends a message
QueueSendBlock Sends a message and block
QueueSendReply Sends a message and request reply
QueueSignalEvents Signals queue events
SemCreate Creates a semaphore
SemDelete Deletes a semaphore
SemGetHandle Gets the handle of a semaphore
SemQueryValue Gets the value of a semaphore
SemReInit Reinitializes a semaphore's value
SemSignal Signals a semaphore
SemWait Waits on a semaphore
ThreadCreate Creates a thread
ThreadDelay Delays the current thread
ThreadDelete Deletes a thread
ThreadGetID Gets the ID of the current thread
ThreadQueryDispatchClass Queries a thread's dispatch class
ThreadQueryEntryPoint Queries a thread's entry point
ThreadQueryParameterList Queries a thread's parameter list
ThreadQueryPriority Queries a thread's priority
ThreadQuerySuspendCount Queries a thread's suspend count
ThreadQueryUserData Queries a thread's user data word
ThreadResume Resumes a thread
ThreadSetDispatchClass Sets the dispatching class affiliation of threads
ThreadSetPriority Sets the dispatching priority of threads
ThreadSetUserData Sets a thread's user data word
ThreadSuspend Suspends a thread
ThreadYield Yields control to another thread
TimerStartInt Starts an interval timer
TimerStartMicros Starts an interval timer
TimerStartTOD Starts a TOD timer
TimerStop Cancels a timer
TimerStopAll Cancels all timers
TimerStopMicros Cancels a timer
TimerTest Queries a timer
TimerTestMicros Queries a timer
TraceControl Defines and queries trace attributes
TraceSignal Signals a trace event with header information
VCPUCreate Creates a virtual processor
VCPUSelect Requests special virtual CPU dispatching