|
|
|
|
|
- Declaration
- Properties specific to ParallelTask variables
- WLanguage functions that use variables of type ParallelTask
ParallelTask (Variable type) In french: TâcheParallèle
The ParallelTask type is used to handle a task, which means a procedure run by a thread in the parallel programming. Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
t is ParallelTask
t = ParallelTaskExecute(Proc, ("Premier paramètre", 2))
t is ParallelTask(Proc, ("Premier paramètre", 2))
ParallelTaskExecute(t)
d is Description of ParallelTask
d.Procedure = Proc
d.Parameter[1] = "Premier paramètre"
d.Parameter[2] = 2
t is ParallelTask = ParallelTaskExecute(d)
Declaring a parallel task that is not described Hide the details
MyVariable is ParallelTask
In this case, the task is not described. The variable will have to be assigned with an existing task or with the result of one of the functions for running parallel tasks.
Describing a parallel task via the ParallelTask type Hide the details
MyVariable is ParallelTask(<Procedure> [, <Parameters> [, <Options>]])
<Procedure>: Character string or Procedure variable Procedure to be executed. This parameter can correspond to: - the name of the procedure to be executed.
- the name of the Procedure variable corresponding to the procedure to be executed.
<Parameters>: List of values enclosed in brackets, separated by commas Parameters of the procedure to be executed. This list of parameters has the following format: (<Parameter 1>, ..., <Parameter N>) where: - <Parameter 1> is the first parameter of the procedure.
- ...
- <Parameter N> is the nth parameter of the procedure.
<Options>: Optional Integer constant Options of task to run: | | ptoDelayedCopyHFSQLContext (Default value) | Triggers a light copy of HFSQL context during the first access to the HFSQL data. | ptoFullCopyHFSQLContext | Triggers the immediate copy of the current HFSQL context. Recommended, for example, if the parallel task must take into account the current positions in the files and queries of the context of the caller. | ptoLightCopyHFSQLContext | Triggers the immediate copy of a part of the current HFSQL context. Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored. | ptoMainThread | Runs the task in the main thread. Warning: This constant cannot be used to execute a parallel task in the main thread from within the main thread. |
In this case, the task is described and its description cannot be modified anymore. The task is not automatically scheduled, therefore, a single declaration will not trigger the execution of the task. You must call one of the functions for running tasks in order to trigger the execution of the task.
Describing a parallel task via a Description of ParallelTask Hide the details
MyVariable is ParallelTask(<Description>)
<Description>: Description of ParallelTask variable Name of the Description of ParallelTask variable describing the task. In this case, the task is described and its description cannot be modified anymore. The task is not automatically scheduled, therefore, a single declaration will not trigger the execution of the task. You must call one of the functions for running tasks in order to trigger the execution of the task. Properties Properties specific to ParallelTask variables The following properties can be used to handle a parallel task:
| | | Property name | Type used | Effect |
---|
Canceled | Boolean | - True if the task is canceled,
- False otherwise.
This property is read-only. | Completed | Boolean | - True if the task is completed,
- False otherwise.
This property is read-only. | New in version 2025Extra | Variant | Allows you to store advanced information without affecting the execution of the application. You can store values of any type (array, etc.). It is also possible to add members to the Extra property. Example:
MyVariable.Extra.Info1 = Value MyVariable.Extra[Info2] = Value2 MyVariable.Extra.Date = DateSys() | Identifier | Integer | Task identifier. This identifier can be used for debugging purpose for example. This property is read-only. | ReturnedValue | Value returned by the task. | Caution: - If the task is still in progress, the ReturnedValue property waits for the end of the task
- If the task is completed without fatal error, the property returns the return values of the procedure of the task.
This property is read-only. | Status | Integer constant | Status of the task: - tpeCancelled: parallel job is cancelled (function ParallelTaskCancel).
- tpeRequestedCancellation: a cancellation request has been made on the parallel task (function ParallelTaskRequestCancellation)..
- tpeWaitExecution the parallel task is waiting to be executed.
- tpePreviousPreviousTask the parallel task waits for the execution of a previous parallel task.
- tpeExecutionInProgress the parallel task is currently running.
- tpeNotScheduled: parallel task is not scheduled.
- tpeTerminated: parallel task completed.
This property is read-only. |
Remarks WLanguage functions that use variables of type ParallelTask - Standard functions:
- Functions with prefix syntax:
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|