Independent participants and synchronized messages?

0 votes
asked Jan 21, 2021 in Question / help by MMAL

I am drawing a quite typical sequence diagram between two threads:

@startuml
participant "Thread #1" as T1 order 10
participant "Thread #2" as T2 order 30

activate T1
note over T1: Initialize
loop Until not needed any more
  note over T1: Do something
  T1 -->T2: Send start signal
  T1-->?: Wait
   deactivate T1

  hnote over T1: Wait for\nend\nsignal
  T1<--?: Wake-up
  activate T1
end
T1 -->x?: Exit
deactivate T1


activate T2
note over T2: Initialize
loop Forever
  T2-->?: Wait
  deactivate T2
  hnote over T2: Wait for\nstart\nsignal
  T2<--?: Wake-up
  activate T2
  note over T2: Do something
  T2 --> T1: Send end signal
end
T2 -->x?: Exit
deactivate T2
@enduml

 Problems:
1) the for loop are extended beyond the participant they are created for
2) The signals should be match the location, where waiting a signal, is there a way to mark anchors or references?
3) deactivation after note do not work, have to have e.g. signal prior deactivation

 

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...