The following pages provide detailed information on the methods of the Thread Class. This class provides the means for starting, stopping, and monitoring the execution of independent threads.
The GPL system supports the simultaneous execution of up to 64 GPL program threads. Each thread has its own execution stack and runs independently of all other threads. If multiple threads are active, each thread executes for up to 1 millisecond before control passes to the next ready thread.
When a GPL project is loaded, one procedure is designated as the main procedure in the project file settings. This main procedure is started by the GDE interface, the web Operator Control Panel, the Start console command, or automatically when the system is restarted.
The main procedure can then start additional procedures as separate threads.
Table 19-104 summarizes the methods and properties that are described in greater detail in the following sections
Member | Type | Description |
---|---|---|
Constructor Method |
Creates a thread object and associates it with a procedure. |
|
Method |
Stops execution of a thread such that it cannot be resumed. |
|
Property |
Sets or gets a numeric value that can be used as a parameter for a thread. |
|
Shared Method |
Returns a thread object for the currently executing thread. |
|
Method |
Waits for a thread to complete execution, with a timeout. |
|
Get Property |
Returns a String containing the name of the thread associated with this object. |
|
Get Property |
Returns a String containing the name of the project associated with this object. |
|
Method |
Resumes execution of a thread that was suspended. |
|
Shared Method |
Changes the execution priority and thread scheduling algorithm for the current thread. |
|
Method |
Sends an event to a thread to notify it that a significant transition has occurred. |
|
Shared Method |
Causes the current thread to stop execution for a specified amount of time. |
|
Method |
Initializes and starts execution of a procedure as an independent thread. |
|
Get Property |
Returns a String containing the name of the start procedure associated with this object. |
|
Method |
Suspends execution of a thread so that it can be resumed. |
|
Shared Method |
Atomically reads a numeric variable and writes a new value. Used for restricting access to data shared between threads. |
|
Get Property |
Returns an integer indicating the execution state of a thread. |
|
Shared Method |
Causes the current thread to wait for an event. |