|Short Description||Simultaneous processing of two or more branches (Threading)|
|Extension||OTX Core library|
|Group||Compund node related actions|
The OTX parallel activity consists of two or more sequences (lanes) which at the same time are processed. At run time, a Thread is started for each branch. The normal run-time behavior of the parallel activity is synchronous. This means that the activity will leave only if all included branches (lanes) is completed.
|Important: The run-time behavior of the branches is indeterminate. To avoid a branch within the activity should not depend on Race Conditions from one another!|
|Important: To guarantee the Thread safety, we recommend that you work within the branch with the MutexGroup activity!|
Then, usually a parallel activity terminates when all contained branches have exits. There are still three more rules for the special termination of parallel activities:
- TerminateLanes activity
- All other sectors included in the parallel activity is the TerminateLanes activity is executed in a branch, is signaled to exit. The other branches run completely yet just in the processing activity:
- Then, the branch is terminated by the following activities to skip.
|Important: A branch is currently in a ProcedureCall activity, the invoked procedure terminates prematurely, after completion of the current activity.|
|Important: Please keep in mind that no time-out exists for the termination of the currently in-progress activities. There is a risk for the production of Deadlocks!|
- Return activity
- The return activity from running in a branch, only this branch terminates immediately. The parallel activity waits for then all contained branches have finished up and then closes the entire procedure.
- An unhandled exception occurs
- An exception in a branch of is thrown, which is not handled within the branch, this branch is terminated immediately. The parallel activity waits then until all contained branches have exited. Then, the exception is propagated to the next higher level of processing. More than an exception thrown, only the first exception is propagated.
funds = 200;
funds = 0;
if ((funds > 100))
Hmi.ConfirmDialog("Spend money", null, @MessageTypes:INFO, null);