How to illustrate multiple threads in a sequence diagram?

How can you clearly illustrate several threads in a sequence diagram or similar diagram?

I could not find clear examples. All the charts that I see are used to illustrate a single thread.




Refresh . The accepted answer was the best example I've seen, but it leaves much to be desired. In the end, I illustrated the flows in separate sequence diagrams. I'm not sure if a sequence diagram necessarily works for multiple threads.

+51
multithreading uml sequence-diagram
Oct 29 '09 at 13:27
source share
5 answers

Here is one diagram that may be useful, and on the left you can see an explanation: http://sdedit.sourceforge.net/multithreading/example/index.html

Multithreading sequence diagram

+23
Oct 29 '09 at 13:30
source share

I found this question on Google and was not a big fan of the accepted answer, so I just came up with my own. This is how I represented the threading model in my application (my organization calls it the "Concurrency point of view"):

Concurrency point of view

Hope this helps someone.

+9
Feb 12 '16 at 19:27
source share

You can use the "par" fragment to model parallel parallel parallel calls. A fragment consists of a rectangle labeled "par". The rectangle is divided into several blocks, each of which represents a flow of execution.

An example is given on this page: http://www.ibm.com/developerworks/rational/library/3101.html#N10227

+5
Mar 06 '14 at 10:57
source share

You might be interested in Message Sequence Charts or MSC.

Here is a slide describing the MSC in a nutshell.

+1
Oct 29 '09 at 13:41
source share

This is a duplicate of sihaya's answer, but with details on how to execute it using tools on the Internet and a good example that will not go away.

The approach to the UML sequence diagram is to use the "par" fragment to model parallel parallel messages. The following is a text description that, when submitted to the PlantUML tool, available on the Internet, will lead to the creation of a chart below.

@startuml Person -> MicrowaveOven : Cook Food activate MicrowaveOven par MicrowaveOven -> MicrowaveOven : Activate Magnetron else MicrowaveOven -> MicrowaveOven : Activate Rotation Motor end MicrowaveOven --> Person : Delicious Food deactivate MicrowaveOven @enduml 

par UML example

0
Dec 13 '17 at 15:52
source share



All Articles