[Openmcl-devel] lock owner: how to access?

Ron Garret ron at flownet.com
Tue Jul 5 11:19:42 PDT 2011

On Jul 2, 2011, at 1:35 AM, Gary Byers wrote:

> The only thing you can generally do (outside of a context like the kernel
> debugger, where all other threads are stopped) is answer the question
> "what thread owned this lock a few cycles ago, when I asked ?"  The answer
> to that question is either useful or misleading, and there's no general
> way of knowing which.

You can make that answer more useful by adding a timestamp (or a counter) to a lock that keeps track of the last time the lock was grabbed.  That lets you determine wether a cycle in the resource contention graph is real or a timing artifact by walking the cycle twice.  If the timestamps/counters haven't changed since the first traverse then you have found a deadlock.


More information about the Openmcl-devel mailing list