views:

14

answers:

0

I'm working on a complex data structure, think of it as an OODBMS storing single-user CAD info, and want a way to explain vulnerability points to justify where I'm locking and the scope of the critical sections that are being used. IO is via memory-mapping to files that are potentially opened multiple times in different threads.

You could regard this as an analysis task rather than design task - the flow of actions that needs to occur is pretty straightforward, all I'm looking to do is clearly explain what parts need protecting.

There are multiple levels of resources being accessed so if I start drawing sequence diagrams for different scenarios, the combinations get out of control.

I've tried writing simple tables with a couple of threads in parallel to provide a vertical timeline, again just to describe a simple scenario. That helps explain the locking for that scenario and why we care about controlling sequence or it's safe to ignore. These seem easier to comprehend for people who aren't very familiar with UML but are still only describing individual scenarios. This sounds a bit like Doug Lea's approach mentioned in this SO Answer but again that's oriented towards describing the threads, not the vulnerabilities.

I've thought about using a State Diagram for just a single thread and adding extra annotations to highlight the vulnerable points, a bit like this other SO answer. If you consider the states as requiring data be available to exit a state, that seems to make more sense than an Activity Diagram.