I really like the new activity diagrams! I've been trying to capture some high-level code flow in my documentation and had a few thoughts about fork.
Currently, you can nest forks but you can't overlap them. In other words:
fork
fork
:work;
fork again
:other work;
end fork // amounts to a join()
end fork
but forked work doesn't always end at the same time. Arguably I'm entering sequence diagram territory here, but it'd be nice to be able to name the fork and join on that thread, something like so:
:Mutex Take; // thread A
fork "Work1" // thread B
:work1;
:work2;
:Cause Interrupt;
fork "Work2" // interrupt context
:Interrupt things happen here;
:Sem Put;
end fork
end fork
:More Thread A1;
:More Thread A2;
:Sem Get;
join "Work2"
:Mutex Release;
The aesthetic difference being that Thread A is drawn in the same column (not two columns centered on the original). "Work1" is short lived but created another execution context which lived beyond work1. Work2 then joins the original thread A column at a Join point.