AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de gestión de procesos / Tareas paralelas
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Triggers the execution of a parallel task.
// Use the syntax 1 
t1 is ParallelTask = ParallelTaskExecute(ProcedureA, (), ptoMainThread)
// Use the syntax 2 
t1 is ParallelTask
t1.Procedure = Procedure3
t2 is ParallelTask = ParallelTaskExecute(t1)
// 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)
Sintaxis

Running a parallel task Ocultar los detalles

<Result> = ParallelTaskExecute(<Procedure> [, <Parameters> [, <Options>]])
<Result>: ParallelTask variable
ParallelTask variable corresponding to the task to run.
<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.
Warning Parameters are passed by value. In the case of variables of complex types (arrays, object), the value is the element itself.. To restrict access to this variable, you can:
<Options>: Optional Integer constant (or combination of constants)
Options of task to run:
ptoDelayedCopyHFSQLContext
(Default value)
Triggers a light copy of HFSQL context during the first access to the HFSQL data.
ptoFullCopyHFSQLContextTriggers 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.
ptoLightCopyHFSQLContextTriggers 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.
ptoMainThreadRuns the task in the main thread.
This constant can be combined with one of the other constants. Warning: This constant cannot be used to execute a parallel task in the main thread from within the main thread.

Note: To find out which type of copy to choose, see comparison between the different copy modes.

Running a parallel task described beforehand (ParallelTask variable) Ocultar los detalles

<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.
Warning: If the task is already running or has already been executed, a WLanguage error will be triggered.

Running a parallel task identified by its description (Description of ParallelTask variable) Ocultar los detalles

<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 that describes the task to be executed.
Observaciones
  • The task is saved in the queue of tasks to run.
  • ParallelTaskExecute is not a blocking function and does not wait for task to be completed.
  • Comparison between the different types of copy for the HFSQL context:
    Type of copyBenefitsDrawbacks
    Full copyCopies:
    • the extensive connection parameters (connections, physical paths, ...).
    • positions, filters, etc. defined on 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 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 provided that you don't change the connection parameters and that you perform the necessary calls to HReadSeek.
Componente: wd300vm.dll
Versión mínima requerida
  • Versión 20
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local