PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Triggers the execution of a parallel task.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 23 and later
Java This function is now available for the Java applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
New in version 23
Java This function is now available for the Java applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Java This function is now available for the Java applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
// Use the syntax 1
t1 is ParallelTask = ParallelTaskExecute(ProcedureA, (), ptoMainThread)
// Use the syntax 2
t1 is ParallelTask = ParallelTaskExecute(ProcedureB, (Today(), TimeSys()))
// Use the syntax 3
t3 is Description of ParallelTask
t3..Procedure = Procedure3

ParallelTaskExecute(t3)
// Use the syntax 3
t3bis is Description of ParallelTask
t3bis..Procedure = Procedure3bis
t3bis..Parameter[1] = Today()
t3bis..Parameter[2] = TimeSys()

ParallelTaskExecute(t3bis)
// Declare several tasks and run a process at the end of all these tasks.

MyTaskDescription is Description of ParallelTask
arrMyTasks is array of ParallelTask // Result of parallel tasks functions

// Task #1
MyTaskDescription..Procedure = Example2_Step1

// Runs the parallel tasks
// Add the task returned to an array of tasks
// in order to re-use them in ParallelTaskExecuteAfterAll
Add(arrMyTasks, ParallelTaskExecute(MyTaskDescription))

// Task #2
MyTaskDescription..Procedure = Example2_Step2
Add(arrMyTasks, ParallelTaskExecute(MyTaskDescription))

// Specify the procedure to run once
// once all the tasks found in the arrMyTasks array are ended
ParallelTaskExecuteAfterAll(arrMyTasks, Example2_End, (), ptoMainThread)
Syntax

Running a parallel task Hide the details

<Result> = ParallelTaskExecute(<Procedure> [, <Parameters> [, <Options>]])
<Result>: ParallelTask variable
ParallelTask variable corresponding to the task to run.
<Procedure>: Character string or Procedure variable
Procedure to run. This parameter can correspond to:
  • the name of procedure to run.
  • the name of Procedure variable corresponding to the procedure to run.
<Parameters>: List of values enclosed in brackets and separated by commas
Parameters of procedure to run. This list of parameters has the following format:
(<Parameter 1>, ..., <Parameter N>)
where:
  • <Parameter 1>: First procedure parameter.
  • ...
  • <Parameter N>: Nth procedure parameter.
<Options>: Optional Integer constant
Options of task to run:
ptoFullCopyHFSQLContextTriggers the immediate copy of current HFSQL context.
Recommended for example if the parallel task must take into account the current positions in the files and queries of caller context.
ptoDelayedCopyHFSQLContext
(Default value)
Triggers a light copy of the HFSQL context during the first access to the HFSQL data.
ptoLightCopyHFSQLContextTriggers the immediate copy of part of 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.
ptoMainThreadRuns the task in the main thread.
Caution: This constant cannot be used to run a parallel task in the main thread from the main thread.
Note: To find out which type of copy to choose, see the comparison between the different copy modes.

Running a parallel task described beforehand (ParallelTask variable) Hide the details

<Result> = ParallelTaskExecute(<Task>)
<Result>: ParallelTask variable
ParallelTask variable corresponding to the task run.
<Task>: ParallelTask variable
Name of the ParallelTask variable corresponding to the task to run.
Caution: A WLanguage error occurs if the task is currently run or if the task was already run.

Running a parallel task identified by its description (Description of ParallelTask variable) Hide the details

<Result> = ParallelTaskExecute(<Task Description>)
<Result>: ParallelTask variable
ParallelTask variable corresponding to the task run.
<Task Description>: Description of ParallelTask variable
Name of the Description of ParallelTask variable describing the task to run.
Remarks
  • The task is saved in the queue of tasks to run.
  • ParallelTaskExecute is not a locking function and it does not wait for the end of the task.
  • Comparison between the different types of copy for the HFSQL context:
    Type of copyBenefitsDrawbacks
    Full copyCopies:
    • the extensive connection parameters (connections, physical paths, ...).
    • the positions, the filters, ... defined on the data files.
    • the queries.
    Memory consumption (on the client and on the server).
    Light copyCopies the extensive connection parameters (connections, physical paths, ...).
    No memory consumption on the server.
    The records and the current filters are not copied. Therefore, the records must be repositioned by HReadSeek for example.
    No copy of queries.
    Memory consumption on the Client computer
    Delayed copyNo memory consumption (on the client and on the server). Risk: If the extended connection parameters are modified, the last modification will be taken into account.
    The records and the current filters are not copied. Therefore, the records must be repositioned by HReadSeek for example.
    No copy of queries.
In most cases, the delayed copy is recommended providing that you don't change the connection parameters and that you perform the necessary calls to HReadSeek.
Related Examples:
Using parallel tasks Unit examples (WINDEV): Using parallel tasks
[ + ] The parallel tasks are used to speed up the process times and to improve the reactivity of an application.
This example presents the functions and types of variables required to use the parallel tasks:
- running parallel tasks,
- interaction with the controls,
- continuation tasks.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment