Using Parallel Statements

A parallel statement spawns a statement for each machine specified and blocks the calling thread until the threads it spawns have all completed. It condenses the actions of spawn and rendezvous and can make code more readable.

The parallel statement executes a single statement for each thread. Thus if you want to run complete tests in parallel threads, use the invocation of a test function, which may execute many statements, with the parallel statement, or use a block of statements with spawn and rendezvous.

To use the parallel statement, you must specify the machines for which threads are to be started. You can follow the parallel keyword with a list of statements, each of which specifies a different Agent name. For example:
parallel
  DoSomething ("Client1")
  DoSomething ("Client2")

The DoSomething function then typically issues a SetMachine(sMachine) call to direct its machine operations to the proper Agent.