Document locking in multithreading environment

Viewed 207

We have an application that supports binary plugins (dynamically loaded libraries) as well as a number of plugins for this application. The application is itself multithreaded and the plugins may also start threads. There's a lot of locking going on to keep data structures consistent.

One major problem is that sometimes locks are held across calls from the application into a plugin. This is problematic because the plugin code might want to call back into the application, producing a deadlock. This problem is aggravated by the fact that different teams work on the base application and the plugins.

The question is: Is there a "standard" or at least widely used way of documenting locking schemes apart from writing tons of plain text?

4 Answers
Related