Parallel Blocks

Sometimes it is desired to express that two separate process happen side-by-side. Parallel blocks allow this. Simply place the the parallel blocks between ‘{}’ marks and write them one after the other, as in the section called “Drawing Things in Parallel”. You can specify as many parallel blocks as you want. The last parallel block shall be termiated with a semicolon. The order of the blocks is irrelevant, with the exception of numbering, which goes in the order the blocks are specified in the source file. It is possible to place anything in a parallel block, arrows, boxes, or other parallel blocks, as well.

By default, elements in parallel blocks are laid out so that they do no overlap. (At the cost of potentially showing elements sequentially even if they were intended to be shown in parallel.) This behaviour is new in version 3.6, so a chart option ‘classic_parallel_layout’ is provided, which returns to the old behaviour. In that mode, no attempt is made to avoid overlaps. The top of each block is drawn at the same vertical position. If you start with two arrows, they may be aligned and appear as a single arrow. To avoid this use the nudge; command in one of the blocks which inserts a small vertical space top mis-align accidentally aligned arrows. This is not needed in case of the new algorithm. Also if elements spanning the entire width of the chart are specified in a parallel block (such as the heading; command and dividers) they trigger a warning.

The next element below the series of parallel blocks will be drawn after the longest of the parallel blocks.

Parallel Keyword

Specifying the keyword parallel in front of an element will make the rest of the chart be drawn in parallel with it. To be more precise the effect only lasts till the end of the scope, so elements after the next closing brace will be drawn sequentially under[25].

You can place parallel in front of really any element, including entity definitions or even parallel blocks. You can even combine several elements using braces.



[25] This is how this works exactly: first, the element marked with parallel is placed. Then the rest of the elements in the scope are placed below it and are moved as one block up at most to the top of the element marked with parallel. The move stops if any element in the block being moved bumps into an already placed element, thus overlaps are avoided.