IBM® i thread management
The concepts described here pertain to all programming languages.
For details about how each language enables a concept, refer to the programmer's guide for that specific language.
- Thread attributes
Thread attributes are thread characteristics that affect the behavior of the thread. Different attributes are available depending on the programming language and the API that you are using. - Starting a thread
When your application creates a thread, the system initializes a thread object, control structures, and runtime support. These allow the new thread to use language constructs and system services safely. - Ending a thread
When a thread has completed its processing, it takes an action to end itself and release system resources for use by other threads. - Canceling a thread
With the ability to end a thread externally, you can cancel threads that run long requests before they are completed on their own. You can use several APIs to cancel threads. - Suspending a thread
It is sometimes useful to stop a thread temporarily from processing in your application. When you suspend a thread, the state of the thread, including all the attributes and locks held by the thread, is maintained until that thread is resumed. - Resuming a thread
If you temporarily stopped a thread from processing in your application, you can resume the processing of the suspended thread at a later time at the same point that you suspended it. - Waiting for a thread to end
When you use threads, it is important to know when a thread finishes processing. Waiting for a thread to perform an action or for an event to happen is called thread synchronization. - Yielding the processor to another thread
At times, your application can benefit if a thread yields the processor to another thread in the system.
Parent topic: Multithreaded applications
Related information: