Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Threads Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

2.9 Threading Package

The Threading package includes the runnable classes, the thread attribute classes, and the IOU classes.

2.9.1 Runnable and Thread Pool 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.

Figure 13: Runnable and thread pool class hierarchy

2.9.2 The Attribute Classes

All of the thread attributes supported by the Threading package are captured within instances of the RWThreadAttribute class, as shown in Figure 14.

Figure 14: Thread attribute class hierarchy

2.9.3 The IOU Class in the Threading Package

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.

Figure 15: IOU hierarchy

2.9.4 Index of Threading Classes

Table 9 contains a list of the classes and global functions and macros in the Threading package.

Table 9: Index of Threading classes 

Class Name Description

RWCancellation

An exception that is thrown in order to stop a cancelled thread.

RWCancellationState

Used with the Synchronization objects to set the cancellation policy.

RWCompletionState

Global enumerator whose values describe the completion state of a runnable object.

RWConcurrencyPolicy

Global enumerator whose values describe whether or not new kernel threads will be created when a new thread is created.

RWContentionScope

Global enumerator whose values describe whether threads contend for processing resources with other threads in the same process or other threads in the system.

RWExecutionState

Global enumerator whose values describe the execution states of a runnable object.

RWInheritancePolicy

Global enumerator values indicate whether the creating thread or the thread attribute provide various defaults.

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.

RWSchedulingPolicy

Global enumerator whose values determine the scheduling policy.

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.

RWStartPolicy

Determines whether a thread is in an interrupted state or is ready to run after the start() operation is complete.

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.

RWThreadManager

Counted pointer handle for RWThreadManagerImp instance, which tttempts orderly thread shutdown at process exit.

rwThreadManager()

Creates and/or gets the current singleton thread manager instance.

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.

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.



Previous fileTop of DocumentContentsIndex pageNext file

© 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.