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

RWThread

Module:  Threads   Package:  Threading


RWThread RWRunnable

Local Index

Members

Header File

#include <rw/thread/RWThread.h>

Description

The RWThread class is a handle class for a threaded runnable object.

A threaded runnable object provides the basic mechanisms used to create, control, and monitor the threads of execution within your application. Threaded runnables create their own thread to perform some task or activity.

Each threaded runnable object is reference-counted; a threaded runnable body instance keeps a count of the number of handles that currently reference it. A runnable object is deleted when the last handle that references the body is deleted.

The public interface for a threaded runnable is provided by its handle classes. Many of the public functions in a handle simply forward control to a corresponding protected function in the body class. A threaded runnable handle class instance may be empty. Any attempt to use an empty handle to access a threaded runnable will produce an RWTHRInvalidPointer exception

The RWThread class provides an interface for threads executing outside of a threaded runnable. It defines the member functions that may only be executed by an external thread. The threads executing inside of a threaded runnable should access the runnable using the RWThreadSelf handle class. Those functions that can be accessed from either inside or outside of a threaded runnable are defined in both handle classes.

You may also convert an RWThreadSelf handle to an RWThread handle by calling the RWThreadSelf::getThread() member, but any attempt to violate the thread access restrictions imposed by the separate interfaces will generally result in an RWTHRIllegalAccess exception.

Static Member Functions

bool
canGetMaxThreads();
bool
canSuspendResume();
size_t
getMaxThreads();

Public Constructors

RWThread();
RWThread(RWStaticCtor);
RWThread(const RWThread& second);

Public Destructor

~RWThread();

Public Member Operator

RWThread&
operator=(const RWThread& second)

Public Member Functions

bool
canGetPriority() const;
bool
canGetProcessScopePriority() const;
bool
canGetSchedulingPolicy() const;
bool
canGetSystemScopePriority() const;
bool
canGetTimeSliceQuantum() const;
bool
canSetPriority() const;
bool
canSetProcessScopePriority() const;
bool
canSetSchedulingPolicy(RWSchedulingPolicy policy) const;
bool
canSetSystemScopePriority() const;
bool
canSetTimeSliceQuantum() const;
RWThreadAttribute
getActiveAttribute() const;
RWThreadAttribute
getAttribute() const;
RWPriority
getMaxPriority() const;
RWPriority
getMaxProcessScopePriority() const;
RWPriority
getMaxSystemScopePriority() const;
unsigned long
getMaxTimeSliceQuantum() const;
RWPriority
getMinPriority() const;
RWPriority
getMinProcessScopePriority() const;
RWPriority
getMinSystemScopePriority() const;
unsigned long
getMinTimeSliceQuantum() const;
RWPriority
getPriority() const;
RWPriority
getProcessScopePriority() const;
RWThreadSelf
getRWThreadSelf() const;
RWSchedulingPolicy
getSchedulingPolicy() const;
unsigned
getSuspendCount() const;
RWPriority
getSystemScopePriority() const;
unsigned long
getTimeSliceQuantum() const;
unsigned
resume();
void
setAttribute(const RWThreadAttribute& second);
void
setPriority(RWPriority priority);
void
setProcessScopePriority(RWPriority priority);
void
setSchedulingPolicy(RWSchedulingPolicy policy);
void
setSystemScopePriority(RWPriority priority);
void
setTimeSliceQuantum(unsigned long milliseconds);
unsigned
suspend();
void
terminate();

NOTE -- this operation kills the associated thread without giving it a chance to release locks, unwind the stack, or recover resources. Use only as a last resort!

Protected Constructors

RWThread(RWThreadImp* threadImpP);

See Also

RWThreadSelf, RWRunnable, RWRunnableHandle, RWThreadFunction, RWTThreadIOUFunction<Return>, RWRunnableServer, RWServerPool, RWThreadAttribute



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.