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.h++ 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 10 contains a list of the classes and global functions and macros in the Threading package.
Class Name | Description |
RWCancellation |
An exception that is thrown in order to stop a cancelled thread. |
RWGuardedRunnableQueue |
A producer-consumer queue for guarded runnables. |
RWProductInfo |
Base class for product-specific information classes. Used to retrieve information about the current library. |
RWRunnable |
Handle class for runnable objects. This class provides an interface that may be used only by threads running outside of the runnable. |
rwRunnable() |
Global function that retrieves the current runnable object, if any, within which the calling thread is executing. |
RWRunnableFunction |
Handle class for synchronous runnable objects that accept a functor for execution. |
RWRunnableHandle |
Base class for all runnable handle classes. |
RWRunnableSelf |
Handle class for runnable objects which provides an interface that may be used only by the thread running inside of a runnable. |
RWRunnableServer |
A runnable that accepts other runnables for execution within its own thread. |
RWRunnableTrap |
Waits for multiple runnables to reach a given execution state. |
RWServerPool |
A runnable object that accepts other runnables for execution and dispatches them to the next available RWRunnableServer object from a pool of such objects. |
rwServiceCancellation() |
Global function that calls serviceCancellation() on the current runnable, if any. |
rwSleep() |
Global function that puts the calling thread to sleep for a specified time period. |
RWThread |
Handle class for threaded runnable objects which provides an interface that may be used only by threads running outside of the threaded runnable. |
rwThread() |
Global function that returns an RWThreadSelf object, if any, associated with the current thread. |
RWThreadAttribute |
RWThreadAttribute gives you control over thread scheduling and stack management. |
RWThreadFunction |
Handle class for threaded runnable objects that accept a functor for execution. |
RWThreadPool |
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. |
RWThreadSelf |
Handle class for threaded runnable objects which provides an interface that may be used only by the thread running inside of a threaded runnable. |
RWThreadsProductInfo |
Threads.h++ product information class. |
rwtMakeRunnableCallback() |
Global helper functions and macros that create functors that may be passed to the addCallback() method of an RWRunnableHandle. |
rwtMakeRunnableFunction() |
Global functions and macros that create an instance of RWRunnableFunction directly from a global or member function pointer. |
rwtMakeRunnableGuard() |
Global template functions and macros for creating RWRunnableGuard objects. |
rwtMakeRunnableIOUFunction() |
Global functions and macros that create an instance of RWTRunnableIOUFunction<Return> directly from a global or member function pointer. |
rwtMakeThreadFunction() |
Global functions and macros that create an instance of RWThreadFunction directly from a global or member function pointer. |
rwtMakeThreadIOU() |
Global function that returns an RWTEscrowHandle<R> that can be used to initialize either an RWTIOUResult<R> or an RWTIOUEscrow<R>. |
rwtMakeThreadIOUFunction() |
Global function that creates an instance of RWTThreadIOUFunction<Return> directly from a global or member function pointer. |
RWTRunnableIOUFunction<Return> |
Handle class for synchronous runnable objects that accept a functor for execution and return the result of the functor as an IOU instance. |
RWTThreadEscrowImp<Redeemable> |
Multi-thread safe IOU Escrow implementation. |
RWTThreadIOUFunction<Return> |
Handle class for threaded runnable objects that accept a functor for execution and return the result of the functor as an IOU instance. |
RWTThreadLocal<Type> |
Declares a thread-local storage object. |
rwYield() |
Global function that causes the calling thread to yield execution to another thread. |
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.