4.3.3. Parallel Rule

[Tip]Description

The parallel rule is a rule-container that defines the parallel execution of the nested rules.

[Important]Syntax
ParallelRuleAST ::= parallel { AsmRulesAST } OptSemicolonAST  

A parallel rule contains an arbitrary number of other ASM rules.

[Note]Semantics

The parallel rule executes all rules listed inside in an arbitrary order in multiple threads. If parallel processing is supported on the host machine rules are executed simultaneously.

The parallel rule fails if at least one of the contained rules fails. The previous state of local variables are not restored after failure.

The parallel rule uses read and write locks when manipulating the model space to avoid concurrency problems. However, no protection is provided for preventing the parallel access of ASM machines, which may result in exceptions reporting concurrent access.

[Warning]Warning

The implementation of the parallel rule is experimental. There is some chance that not all conflicting assignments (carried out in different threads) are detected.

Defined In:  compound rule

See Also:  sequential rule, random rule