The Threading package includes the runnable classes, the thread attribute classes, and the IOU classes.
Runnable objects in the Threading package are implemented by using the handle-body idiom. Figure 13 illustrates the runnable and thread pool class hierarchy in this package. For complete information about the Threading package, see Chapter 3 of the Threads Module User's Guide.
All of the thread attributes supported by the Threading package are captured within instances of the RWThreadAttribute class, as shown in Figure 14.
Figure 15 shows the IOU class hierarchy, in which the majority of the classes belong to the Interthread Communication package. The hierarchy is duplicated here because the piece that makes IOUs usable is RWTThreadEscrowImp, from the Threading package. This class has the mechanisms for synchronizing multithread access to the result and blocking threads that have attempted to redeem the result before it has been supplied.
Table 9 contains a list of the classes and global functions and macros in the Threading package.
Class Name | Description |
An exception that is thrown in order to stop a cancelled thread. | |
Used with the Synchronization objects to set the cancellation policy. | |
Global enumerator whose values describe the completion state of a runnable object. | |
Global enumerator whose values describe whether or not new kernel threads will be created when a new thread is created. | |
Global enumerator whose values describe whether threads contend for processing resources with other threads in the same process or other threads in the system. | |
Global enumerator whose values describe the execution states of a runnable object. | |
Global enumerator values indicate whether the creating thread or the thread attribute provide various defaults. | |
Handle class for runnable objects. This class provides an interface that may be used only by threads running outside of the runnable. | |
Global function that retrieves the current runnable object, if any, within which the calling thread is executing. | |
Handle class for synchronous runnable objects that accept a functor for execution. | |
Base class for all runnable handle classes. | |
Handle class for runnable objects which provides an interface that may be used only by the thread running inside of a runnable. | |
A runnable that accepts other runnables for execution within its own thread. | |
Waits for multiple runnables to reach a given execution state. | |
Global enumerator whose values determine the scheduling policy. | |
A runnable object that accepts other runnables for execution and dispatches them to the next available RWRunnableServer object from a pool of such objects. | |
Global function that calls serviceCancellation() on the current runnable, if any. | |
Global function that puts the calling thread to sleep for a specified time period. | |
Determines whether a thread is in an interrupted state or is ready to run after the start() operation is complete. | |
Handle class for threaded runnable objects which provides an interface that may be used only by threads running outside of the threaded runnable. | |
Global function that returns an RWThreadSelf object, if any, associated with the current thread. | |
RWThreadAttribute gives you control over thread scheduling and stack management. | |
Handle class for threaded runnable objects that accept a functor for execution. | |
Counted pointer handle for RWThreadManagerImp instance, which tttempts orderly thread shutdown at process exit. | |
Creates and/or gets the current singleton thread manager instance. | |
A pool of RWThread instances that do work encapsulated into functors. RWThreadPool is a high-performance alternative for users who don't need all the functionality of RWServerPool. | |
Handle class for threaded runnable objects which provides an interface that may be used only by the thread running inside of a threaded runnable. | |
Global helper functions and macros that create functors that may be passed to the addCallback() method of an RWRunnableHandle. | |
Global functions and macros that create an instance of RWRunnableFunction directly from a global or member function pointer. | |
Global template functions and macros for creating RWRunnableGuard objects. | |
Global functions and macros that create an instance of RWTRunnableIOUFunction<Return> directly from a global or member function pointer. | |
Global functions and macros that create an instance of RWThreadFunction directly from a global or member function pointer. | |
Global function that returns an RWTEscrowHandle<R> that can be used to initialize either an RWTIOUResult<R> or an RWTIOUEscrow<R>. | |
Global function that creates an instance of RWTThreadIOUFunction<Return> directly from a global or member function pointer. | |
Handle class for synchronous runnable objects that accept a functor for execution and return the result of the functor as an IOU instance. | |
Multi-thread safe IOU Escrow implementation. | |
Handle class for threaded runnable objects that accept a functor for execution and return the result of the functor as an IOU instance. | |
Declares a thread-local storage object. | |
Global function that causes the calling thread to yield execution to another thread. |
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.