Reputation: 2357
While debugging an issue with our system, I have discovered a thread contention that is causing a bottleneck. I need to explain the phenomenon to other people involved in handling this issue. Some of them are not from development team (yet, they are reasonably technical). So what type of diagrams can be used to depict threading issues such as contentions, deadlocks etc? Some examples would be very useful.
Upvotes: 5
Views: 1681
Reputation: 1379
Sequence diagrams from UML are probably the best choice. To show multiple threads, each thread has a vertical bar showing the start and termination (termination is an X at the bottom of the bar), of the thread. Arrows between the vertical bars show messages passed between threads, while an arrow that points back to itself shows the thread making a call on itself.
For some examples, see: http://www.agilemodeling.com/artifacts/sequenceDiagram.htm
Upvotes: 0
Reputation: 55937
Doug Lea (concurrent programming in Java) uses A vertical time-line with columns for the threads, then a row in the column captures state at any given time.
A succession of rows captures a sequence of events.
The problem is that much of the discssion needs to consider various permutations of possible state changes.
I wonder whether a PowerPoint animated version of these diagrams would help for the audience you have in mind.
Upvotes: 3
Reputation: 4230
Wait-for graphs can be useful, which help to diagram the dependencies between resources and threads.
Upvotes: 1
Reputation: 1720
If it doesn't have to be a diagram you could write simple (verbose) programs. Just like the way any textbooks teach concurrency/deadlock issues.
Upvotes: 0
Reputation: 5963
The same way one diagrams network communication at the datagram level.
Eg, you draw one timeline for each thread, and then your cross-thread communication consists of lines which connect those timelines at the points of sending on one, and receiving on the other.
Upvotes: 3