ParallelExecution

This page contains an applet that should appear as a separate window.

The ThreadedComposite actors in this model have delay 0.0 and just copy their input tokens to the output, so executing this model produces an interleaving of two counting sequences, one counting up, and one counting down.

However, the ThreadedComposites take a full 1.0 and 1.5 seconds respectively to execute (this implemented with a Sleep actor inside). That execution occurs in parallel so the total time between outputs is approximately 1.5 seconds (the other actors all execute so quickly that their execution time is not noticable).

This illustrates that ThreadedComposite can be used to execute actors concurrently. If they block on I/O, for example, they will not block other actors except as necessary to preserve DE semantics. On a multicore machine, the ThreadedComposites can execute on separate cores, thus exploiting parallelism.

\ \ MoML specification for this model. \