APLX Help : Multi-tasking support : Using 'delta' properties to share data
|
|
Using 'delta' properties to share data between tasks |
|
Any property name which starts with the delta character This feature works in a special way for child task objects. A delta property for the System object of a child task is the same as the delta property of the same name in the parent task's child task object. Thus the parent task can assign arbitrary data to a delta property, and the child task can access it through its own System object. If the child task writes to a delta property of its System object, the parent can see the data which has been assigned in the child task object. For example: Task1←'⎕' ⎕NEW 'APL' Task1.wssize←200000 ⋄ Task1.background←1 Task1.∆MESSAGE←'Startup' Task1.Open Task1.Execute "'⎕' ⎕WI '∆MESSAGE' 'OK'" Task1.∆MESSAGE OK This technique can be used in a number of ways. When starting a task, it can be used to pass an overlay containing all the functions and variables which the child task will need to run. When the task is running, delta properties can be used to share state information, parameters and results between the parent and the child. The delta property persists for as long as the child task object exists in the parent task. This means that a child task can write to a delta property, and then terminate. The data will still be available to the parent. Special considerations for Client-Server versions of APLXIf you are running a Client-Server implementation of APLX, your APL tasks may not all be running on the same machine. However, you can still use delta properties to share data between them. The actual data is held (in memory) on the Client machine, and will be sent over the network to/from the APL task as required. All of this is transparent - you do not need to do anything special for this to work. The only issue to be aware of is that delta variables (like other |
|
APLX Help : Multi-tasking support : Using 'delta' properties to share data
|
Copyright © 1996-2010 MicroAPL Ltd