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 0 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 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
                            • M Mladen Jankovic

                              Nagy Vilmos wrote:

                              There's a useful UML diagram, not sequence

                              Activity diagrams?

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

                              C Offline
                              C Offline
                              computer_nerd
                              wrote on last edited by
                              #21

                              I agree. I read martin Fowler's UML distilled a while ago and activity diagrams are suitable for showing multiple threads. You can branch off and join up again. They look like flowcharts. I think that's the closest UML one for what you want

                              T 1 Reply Last reply
                              0
                              • C computer_nerd

                                I agree. I read martin Fowler's UML distilled a while ago and activity diagrams are suitable for showing multiple threads. You can branch off and join up again. They look like flowcharts. I think that's the closest UML one for what you want

                                T Offline
                                T Offline
                                Tony James SE
                                wrote on last edited by
                                #22

                                I have a good book called "Doing Hard Time" by Bruce Powel Douglass - he uses quite a few different types of UML diagrams, but I think Chapter 8 on "Architectural Design" is most relevant here. The Concurrent Sequence Diagram on p378 is also known as a swim lane diagram; he then shows the same (robot -based) example as a Concurrent Collaboration Diagram and a Concurrent Timing Diagram. He also describes a lot of real-time patterns like watchdogs and monitor-actuators. He provides a swim-lane representation of each pattern.

                                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