SourcePro® 2022.1 |
SourcePro® API Reference Guide |
The Threading package contains prebuilt, fundamental threading classes, giving you a head-start on building portable, multithreaded applications.
The Threading package includes the runnable classes, the thread attribute classes, and the IOU classes.
For complete information about the Threading package, see the Threads Module User's Guide.
Classes | |
class | RWCancellation |
Represents an exception that is thrown to cancel a thread. More... | |
class | RWRunnable |
Handle class for a runnable object, i.e. one that controls an application's threads of execution. More... | |
class | RWRunnableFunction |
Handle class for functor-based, runnable objects. More... | |
class | RWRunnableHandle |
Base class from which all runnable object handles derive. More... | |
class | RWRunnableSelf |
Handle class for a runnable object. More... | |
class | RWRunnableServer |
Represents a runnable server for executing runnable objects. More... | |
class | RWRunnableTrap |
Waits for a number of runnables or threads to reach a certain execution state. More... | |
class | RWServerPool |
Manages a pool of RWRunnableServer instances used to start runnable objects submitted for execution by other threads. More... | |
class | RWThread |
Handle class for a threaded runnable object. More... | |
class | RWThreadAttribute |
Encapsulates a set of attributes that define or control thread scheduling and stack allocation. More... | |
class | RWThreadFunction |
Handle class for functor-based threaded runnable objects. More... | |
class | RWThreadManager |
Attempts orderly thread shutdown at process exit. More... | |
class | RWThreadPool |
Manages a pool of RWThread instances used to execute work encapsulated as RWTFunctor<void()> functors. More... | |
class | RWThreadSelf |
Handle class for a threaded runnable object. More... | |
class | RWTRunnableIOUFunction< Return > |
Handle class for functor-based runnable objects. More... | |
class | RWTThreadEscrowImp< Redeemable > |
Multithread-safe implementation of RWTEscrowImp. More... | |
class | RWTThreadIOUFunction< Return > |
Handle class for functor-based threaded runnable objects. More... | |
class | RWTThreadLocal< Type > |
Provides thread-local storage with simple by-value semantics. More... | |
Macros | |
#define | RW_THR_HAS_CONCURRENCY_POLICY |
#define | RW_THR_HAS_CONTENTION_SCOPE |
#define | RW_THR_HAS_DUAL_PRIORITY |
#define | RW_THR_HAS_INHERITANCE_POLICY |
#define | RW_THR_HAS_MAX_THREADS |
#define | RW_THR_HAS_PARTIAL_STACK_COMMITMENT |
#define | RW_THR_HAS_PRIORITY |
#define | RW_THR_HAS_PROCESS_SCOPE_PRIORITY |
#define | RW_THR_HAS_SCHEDULING_POLICY |
#define | RW_THR_HAS_STACK_COMMIT_SIZE |
#define | RW_THR_HAS_STACK_RESERVE_SIZE |
#define | RW_THR_HAS_START_POLICY |
#define | RW_THR_HAS_SUSPEND_RESUME |
#define | RW_THR_HAS_SYSTEM_SCOPE_PRIORITY |
#define | RW_THR_HAS_TIME_SLICE_QUANTUM |
#define | RW_THR_HAS_USER_STACK |
#define RW_THR_HAS_CONCURRENCY_POLICY |
This configuration macro indicates the build environment has support for specifying the concurrency policy. If this macro is not defined, any attempt to set the concurrency policy will fail.
#define RW_THR_HAS_CONTENTION_SCOPE |
This configuration macro indicates the build environment has support for specifying the contention scope. If this macro is not defined, any attempt to set the contention scope will fail.
#define RW_THR_HAS_DUAL_PRIORITY |
This configuration macro indicates the build environment has support for dual priority threads.
#define RW_THR_HAS_INHERITANCE_POLICY |
This configuration macro indicates the build environment has support for specifying the inheritance policy. If this macro is not defined, any attempt to set the inheritance policy will fail.
#define RW_THR_HAS_MAX_THREADS |
This configuration macro indicates the build environment has support for determining the maximum number of user threads. If this macro is not defined any attempt to get the maximum thread count will fail.
#define RW_THR_HAS_PARTIAL_STACK_COMMITMENT |
This configuration macro indicates the build environment allows partial stack commitment and the stack commit size may be set to a value less than the stack reserve size. If this macro is not defined, then the stack reserve size and stack commit size attributes are mutually exclusive and only one or the other may be set.
#define RW_THR_HAS_PRIORITY |
This configuration macro indicates the build environment has support for getting and setting thread priorities. If this macro is not defined, any attempt to get or set the thread priority will fail.
#define RW_THR_HAS_PROCESS_SCOPE_PRIORITY |
This configuration macro indicates the build environment has support for specifying process scope priority. If this macro is not defined, any attempt to set the process scope priority will fail.
#define RW_THR_HAS_SCHEDULING_POLICY |
This configuration macro indicates the build environment has support for specifying the scheduling policy. If this macro is not defined, any attempt to set the scheduling policy will fail.
#define RW_THR_HAS_STACK_COMMIT_SIZE |
This configuration macro indicates the build environment has support for specifying the stack commit size. If this macro is not defined, any attempt to set the stack commit size will fail.
#define RW_THR_HAS_STACK_RESERVE_SIZE |
This configuration macro indicates the build environment has support for specifying the stack reserve size. If this macro is not defined, any attempt to set the stack reserve size will fail.
#define RW_THR_HAS_START_POLICY |
This configuration macro indicates the build environment has support for specifying a start policy. If this macro is not defined, any attempt to set the start policy will fail.
#define RW_THR_HAS_SUSPEND_RESUME |
This configuration macro indicates the build environment has support for specifying the contention scope. If this macro is not defined, any attempt to suspend or resume a thread will fail.
#define RW_THR_HAS_SYSTEM_SCOPE_PRIORITY |
This configuration macro indicates the build environment has support for specifying system scope priority. If this macro is not defined, any attempt to set the priority of a system scope thread will fail.
#define RW_THR_HAS_TIME_SLICE_QUANTUM |
This configuration macro indicates the build environment has support for specifying the time slice quantum. If this macro is not defined, any attempt to set the time slice quantum will fail.
#define RW_THR_HAS_USER_STACK |
This configuration macro indicates the build environment has support for specifying a user stack. If this macro is not defined, any attempt to set a user stack will fail.
enum RWCompletionState |
RWCompletionState values describe the completion state of a runnable object. These values are returned by the getCompletionState() member functions of all runnable handles.
enum RWConcurrencyPolicy |
RWConcurrencyPolicy values describe whether new kernel threads are created at each new thread creation.
enum RWContentionScope |
RWContentionScope values describe whether threads contend for processing resources with other threads in the same process or other threads in the system.
enum RWExecutionState |
RWExecutionState values describe the execution states of a runnable object. These values are returned by the getExecutionState() member functions of all runnable handles. A newly constructed runnable starts in RW_THR_INITIAL. After the application calls RWRunnable::start() on the runnable handle, but before the target executable code is executed, the runnable is in RW_THR_STARTING. While the runnable is executing its executable code, the runnable is in RW_THR_RUNNING. After the runnable finishes, it returns to RW_THR_INITIAL.
The other RWExecutionState values correspond to operations made through the runnable's handle. A runnable enters the RW_THR_YIELDING or RW_THR_SLEEPING states only if the runnable handle's methods are called to yield or sleep. The global functions rwYield() or rwSleep() do not change the state of the runnable.
Enumerator | |
---|---|
RW_THR_INITIAL |
Constructed; waiting for start or restart |
RW_THR_STARTING |
Runnable started, but has not started executing yet |
RW_THR_RUNNING |
Active, executing |
RW_THR_INTERRUPTED |
Active; Waiting for RWRunnable::releaseInterrupt() |
RW_THR_SUSPENDED |
Active; Waiting for RWThread::resume() |
RW_THR_SLEEPING |
Active; Waiting for expiration of sleep period |
RW_THR_YIELDING |
Active; Yielded execution to other runnables, waiting for execution |
RW_THR_CANCELING |
Active; Runnable cancellation in progress (CANCELING replaces RUNNING) |
RW_THR_ABORTING |
Active; Aborting cancellation (ABORTING replaces CANCELING) |
RW_THR_TERMINATING |
Active; Terminating an RWThread runnable |
RW_THR_EXCEPTION |
Active; Exiting with an exception |
RW_THR_SERVER_WAIT |
Active; Server waiting for another runnable to execute |
enum RWInheritancePolicy |
RWInheritancePolicy values indicate whether default settings are provided by the creating thread or the thread attribute.
enum RWSchedulingPolicy |
RWSchedulingPolicy values determine the scheduling policy.
enum RWStartPolicy |
Determines whether a thread is in an interrupted state or is ready to run after the RWThread::start() operation is complete.
Enumerator | |
---|---|
RW_THR_START_RUNNING |
A newly created thread may run as soon as the RWThread::start() operation is complete. |
RW_THR_START_INTERRUPTED |
A newly created thread is left in an interrupted state upon return from the RWThread::start() invocation that created it. The thread must be explicitly released from the interrupt before it will execute the RWRunnable::run() method. |
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |