A method, apparatus, and system are provided for monitoring resource
operations and detecting lock acquisition hierarchy violations in
multithreaded programs. In one embodiment, a lock acquisition hierarchy
graph is constructed to facilitate monitoring of resource operations
performed by each of a plurality of threads of a multithreaded program.
The resource operations performed by each thread are monitored by a
monitor. Any violation in the hierarchy is detected by a detector, which
is triggered with an occurrence of a change in the graph.