Boost logo

Threads-Devel :

Subject: [Threads-devel] hierarchical_mutex for lock hierarchies (to avoid deadlocks)
From: Fredrik Orderud (forderud_at_[hidden])
Date: 2013-02-17 16:32:52

I've registered a Trac "feature request" for a "hierarchical" mutex to
facilitate lock hierarchies [1] in boost. Lock hierarchies is a construct
that associates mutexes with software layer numbers, and enforces the
application to only lock "downwards" in the software hierarchy [2]. This
effectively translates potential deadlocks into deterministic run-time
failures that can more easily be detected during testing.

An example draft implementation is attached to the issue. The attachment
also includes a BOOST_THREAD_LOCAL work-around for missing "thread_local"
support that should probably be moved to more neutral ground

Please let me know if there are any questions regarding the usefulness of
hierarchical_mutex, or comments on the implementation, and I'll do my best
to assist.


Fredrik Orderud



Threads-Devel list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at