Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Best way to describe a threaded application ? (diagrams)

Best way to describe a threaded application ? (diagrams)

Scheduled Pinned Locked Moved The Lounge
designquestion
22 Posts 15 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Maximilien
    wrote on last edited by
    #1

    I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

    Nihil obstat

    A R M J S 11 Replies Last reply
    0
    • M Maximilien

      I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

      Nihil obstat

      A Offline
      A Offline
      AspDotNetDev
      wrote on last edited by
      #2

      Don't know, but https://www.draw.io/ is a nice tool to do the drawing in.

      Thou mewling ill-breeding pignut!

      M 1 Reply Last reply
      0
      • A AspDotNetDev

        Don't know, but https://www.draw.io/ is a nice tool to do the drawing in.

        Thou mewling ill-breeding pignut!

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        I have Visio, (and pen and paper) , but it is the "type" of diagrams that I'm inquiring about.

        Nihil obstat

        1 Reply Last reply
        0
        • M Maximilien

          I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

          Nihil obstat

          R Offline
          R Offline
          RedDk
          wrote on last edited by
          #4

          http://www.visual-paradigm.com/[^] In tests, it looks like you can customize. Seemed full-featured to me.

          1 Reply Last reply
          0
          • M Maximilien

            I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

            Nihil obstat

            M Offline
            M Offline
            Matthew Faithfull
            wrote on last edited by
            #5

            In theory at least you're looking at a sequence diagram with swim lanes. In practice this may require a very large sheet of paper indeed depending on the design.

            "The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)

            M 1 Reply Last reply
            0
            • M Matthew Faithfull

              In theory at least you're looking at a sequence diagram with swim lanes. In practice this may require a very large sheet of paper indeed depending on the design.

              "The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)

              M Offline
              M Offline
              Maximilien
              wrote on last edited by
              #6

              Interesting, will look into that. After a quick googling, sequence diagrams look to be the diagram of choice (at least to describe synchronization points). Thanks.

              Nihil obstat

              1 Reply Last reply
              0
              • M Maximilien

                I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

                Nihil obstat

                J Offline
                J Offline
                jschell
                wrote on last edited by
                #7

                Maximilien wrote:

                What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ?

                There is of course no way to do that because code, not threads, provide synchronization. If you want to demonstrate that an object or several objects are intended to work in a thread safe manner then you would normally use a sequence diagram. However using such a diagram solely to indicate that the classes need to be thread safe seems like overkill to me. You can after just add a note to the class in the class diagram noting the same thing either on the class or the relationship between two classes.

                1 Reply Last reply
                0
                • M Maximilien

                  I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

                  Nihil obstat

                  S Offline
                  S Offline
                  S Houghtelin
                  wrote on last edited by
                  #8

                  This Diagram?[^]

                  It was broke, so I fixed it.

                  M 1 Reply Last reply
                  0
                  • S S Houghtelin

                    This Diagram?[^]

                    It was broke, so I fixed it.

                    M Offline
                    M Offline
                    Maximilien
                    wrote on last edited by
                    #9

                    Fuzzy spaghetti ? :rolleyes:

                    Nihil obstat

                    S 1 Reply Last reply
                    0
                    • M Maximilien

                      I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

                      Nihil obstat

                      B Offline
                      B Offline
                      Brisingr Aerowing
                      wrote on last edited by
                      #10

                      Using a needle?

                      Gryphons Are Awesome! ‮Gryphons Are Awesome!‬

                      1 Reply Last reply
                      0
                      • M Maximilien

                        I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

                        Nihil obstat

                        N Offline
                        N Offline
                        Nagy Vilmos
                        wrote on last edited by
                        #11

                        There's a useful UML diagram, not sequence, but I'm not in the mood to look it up. I'll try to remember to look tomorrow and get back to you.

                        Reality is an illusion caused by a lack of alcohol

                        M M 2 Replies Last reply
                        0
                        • N Nagy Vilmos

                          There's a useful UML diagram, not sequence, but I'm not in the mood to look it up. I'll try to remember to look tomorrow and get back to you.

                          Reality is an illusion caused by a lack of alcohol

                          M Offline
                          M Offline
                          Maximilien
                          wrote on last edited by
                          #12

                          "Not in the mood?! Mood's a thing for cattle and love play, not looking"

                          Nihil obstat

                          N 1 Reply Last reply
                          0
                          • M Maximilien

                            "Not in the mood?! Mood's a thing for cattle and love play, not looking"

                            Nihil obstat

                            N Offline
                            N Offline
                            Nagy Vilmos
                            wrote on last edited by
                            #13

                            Do you want the elephant diagram or not?

                            Reality is an illusion caused by a lack of alcohol

                            M 1 Reply Last reply
                            0
                            • N Nagy Vilmos

                              Do you want the elephant diagram or not?

                              Reality is an illusion caused by a lack of alcohol

                              M Offline
                              M Offline
                              Maximilien
                              wrote on last edited by
                              #14

                              Yeah, that would be dandy. :-)

                              Nihil obstat

                              1 Reply Last reply
                              0
                              • N Nagy Vilmos

                                There's a useful UML diagram, not sequence, but I'm not in the mood to look it up. I'll try to remember to look tomorrow and get back to you.

                                Reality is an illusion caused by a lack of alcohol

                                M Offline
                                M Offline
                                Mladen Jankovic
                                wrote on last edited by
                                #15

                                Nagy Vilmos wrote:

                                There's a useful UML diagram, not sequence

                                Activity diagrams?

                                more from me | GALex: C++ Library for Advanced Genetic Algorithms

                                C 1 Reply Last reply
                                0
                                • M Maximilien

                                  Fuzzy spaghetti ? :rolleyes:

                                  Nihil obstat

                                  S Offline
                                  S Offline
                                  S Houghtelin
                                  wrote on last edited by
                                  #16

                                  Maximilien wrote:

                                  Fuzzy spaghetti ?

                                  No, threads, made with fuzzy logic! :-D

                                  It was broke, so I fixed it.

                                  1 Reply Last reply
                                  0
                                  • M Maximilien

                                    I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

                                    Nihil obstat

                                    T Offline
                                    T Offline
                                    theclai
                                    wrote on last edited by
                                    #17

                                    You should try Enterprise Architect, you can google it

                                    1 Reply Last reply
                                    0
                                    • M Maximilien

                                      I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

                                      Nihil obstat

                                      F Offline
                                      F Offline
                                      Fabio Franco
                                      wrote on last edited by
                                      #18

                                      Try playing around with Windows Workflow Foundation designer. To me it represents several types of parallel tasks quite nicely.

                                      To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson ---- Our heads are round so our thoughts can change direction - Francis Picabia

                                      1 Reply Last reply
                                      0
                                      • M Maximilien

                                        I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

                                        Nihil obstat

                                        S Offline
                                        S Offline
                                        SlowFatRunner
                                        wrote on last edited by
                                        #19

                                        Here's a recent an example of a sorta sequence diagram that I created in Visio in order to illustrate two threads : http://imm.io/19d1N[^] Hope it helps ...

                                        1 Reply Last reply
                                        0
                                        • M Maximilien

                                          I'm trying to design a threaded application. What would be the best way to graphically represent the different worker threads interaction in regards to synchronization (to/from the main application thread) ? I was thinking of something like a UML sequence diagram. Is there something better ? Thanks.

                                          Nihil obstat

                                          K Offline
                                          K Offline
                                          Kimberley Barrass
                                          wrote on last edited by
                                          #20

                                          Well, sequence diagrams as a part of your overall documentation set are fine, but with anything operating over multiple threads in a modern microcomputerarchitecture where threads can be allocated individual cores, what I think you are looking for is something a little more focussed. If you are using your program (User threading) alone to control threading within a single process, then I would develop a set of livelock and deadlock scenarios which could occur within your process using some kind of state diagram/table. Deadlock in particular is easily avoided with well formed state transitions when you are using non-cpu based threads (All IO is effectively synchronous and the threading is in fact just time-splicing rather than anything else). When using true threads outside of the control of your own code, then consider either: a:) Wrapping a thread controller class around your running threads. The controller has a forward running check which can effectively interrupt a thread if no forward progress is being made on a thread. With this option, class, sequence and interaction diagrams along with state diagrams suffice, paying attention to the new class/(es), but it is necessary to make sure that this thread itself is not locked. If possible fork it into a new process space, possibly with new affinity. This will also alter your exception heirarchy and will require thought as to how to deal with refusals or returns by the thread controller. (Highly recommended in complex scenarios, particularly with high, precise I/O required, but where loss is acceptable (Computer games, etc)) b:) Isolate the most likely blocking activity and thread out these activities in a class/(es) which allows buffering and non blocking messaging into the class. This can be done in a loss-less manner, but can be slow. Again, the class, sequence and interaction diagrams along with state diagrams are all that are required for this mechanism. All of these are standard diagrams and can easily be done in Visio, but the most most important thing is to understand what your threads are doing, and to anticipate the exception scenarios. In particular, if you are considering terminating a thread from a controller, then be wary of leaving library state changed, or heap memory un-released. Good luck with your endeavours anyway.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups