The All Locks tab displays information about all critical sections, and WaitForXXXObject calls in the application being monitored.
Read on, or click a part of the image below to jump straight to the help for that area.
The Locks view shows information about each critical section used by the target application.
Each critical section is shown once and the display can be sorted by different criteria by clicking on the appropriate column header.
The table highlights error and status conditions using the user defined lock colours. In the example above, red indicates a deadlock, yellow contention and cyan recursion.
Lines highlighted in grey denote an active status, meaning that the critical section has been entered, while the white lines show sections where nothing of interest has happened yet.
The following table lists all the available columns of data:
Attribute |
Description
|
•Address |
Address of the critical section, the handle for a WaitForSingleObject call, or the number of handles for a WaitForMultipleObjects call.
|
•Lock |
Number of times the critical section has been locked by any thread.
|
•Recursion |
Number of times the critical section has been re-entered whilst locked by the current thread.
|
•Contention |
Number of attempts a thread has made to acquire the critical section but has had to wait because it is owned by another thread.
|
•Wait Time |
Total time spent waiting by all threads to gain access to this critical section.
|
•Sequence |
The sequence id is an internal monotonic integer that is incremented for each synchronization object event. This integer allows you to identify the order in which events occurred.
|
•Thread |
Thread id (in decimal notation) of the thread that currently owns the critical section.
|
•State |
Current state of the thread, obtained by polling the operating system for data at regular intervals.
|
•Owning Module |
One or more of the following values if available, shown in order of priority with most important first:
•Symbol name (within 256 bytes of the critical section address) for the critical section •Filename and line number of the code location that acquired the lock, determined from the callstack (if collected) •Filename and line number of the critical section •Name of the owning module, if the critical section is static data inside a module (DLL or EXE) •Data indicating dynamic memory or stack space
Some of these details can be optionally hidden using the Display options. |
All the cells in the table that show timing or count data have a percentage bar indicating the item's value relative to the maximum value in the column.
Not all bars are percentages. In the Sequence column, the markers indicate the relative position of the sequence id (see table above) with respect to the first sequence id and most recent sequence id.
•Update Interval automatically updates the display at your choice of interval, from 0.1 to 60 seconds
This should be set depending on the complexity of your application.
An update interval that is too short may mean Thread Validator spends too much time updating the display.
•Refresh updates the display - as does the button on the Tools menu and toolbar
You can sort the data in the table by clicking in the table header.
See what data is available for descriptions of each column.
Note that while your application is executing, the sorted data is live. Sorting may not complete correctly as the data may change during the sort. Only when your program has finished executing is the sorted data guaranteed accurate.
The Locks Settings dialog controls a small number of highlighting and display options.
•Display... show the Locks Settings dialog:
Highlighting settings:
•Highlight active initialised (entered) critical sections are shown in the active colour (grey by default)
•Highlight contended critical sections that have had to wait are shown in the contending colour (yellow )
•Highlight recursion re-entered critical sections are shown in the recursion colour (cyan )
The next three display settings control the display of Module, Filename and Class in the Owning Module data column.
Other options include:
•Reset resets these values to their startup values (all checked)
•Apply apply the settings to the Locks view without closing the dialog
The following popup menu is available over the data area to add filters, examine more details or edit code.
Menu actions apply to the function for the row at the menu-click location.
•Information about lock/wait... shows the relevant information dialog from those below, and depending on the type of item selected
These information dialogs do not block the application so you can show as many as you need, either from this tab or others, and leave them open to compare or investigate later.
•Lock Acquisition Order shows the Locks and Waits in Sequence Order dialog
This dialog displays the order...
•in which critical sections are locked and waited upon
•that waits are entered into
•in which threads sleep and are suspended
•Edit Source Code... opens the default or preferred editor to edit the source code
•Show Creation Callstack... shows the Critical Section Callstack dialog for the creation of this item, i.e. the locked or waiting critical section and thread
The following menu item is only available over contended critical sections (highlighted in yellow by default)
•Show contended callstacks... shows the Contended Critical Sections dialog for this item
This dialog can only be shown if the callstack information is still available. If not you'll hear a beep.
The following menu item is only available over recursing critical sections (highlighted in light blue by default)
•Show recursion callstacks... shows the Recursing Critical Sections dialog for this item
This dialog is very similar to the one for contentions, above.
As above, this dialog can only be shown if the callstack information is still available. If not you'll hear a beep.
•Show busy lock callstacks... shows the busy Critical Sections dialog for this item
This dialog is very similar to the one for contentions, above.
As above, this dialog can only be shown if the callstack information is still available. If not you'll hear a beep.
•Show slow lock callstacks... shows the slow Critical Sections dialog for this item
This dialog is very similar to the one for contentions, above.
As above, this dialog can only be shown if the callstack information is still available. If not you'll hear a beep.
•Show lock callstacks... shows the Critical Sections dialog for this item
This dialog is very similar to the one for contentions, above.
As above, this dialog can only be shown if the callstack information is still available. If not you'll hear a beep.