Please enable JavaScript to view this site.

Thread Validator Help

Navigation: The User Interface > Query and Search

Potential deadlock detection

Scroll Prev Top Next More

 

The deadlock and potential deadlock settings allow Thread Validator to regularly scan for various error conditions using the same data collected by the options on the Collect tab.

 

If your application has many threads, you may prefer to disable these options to prevent Thread Validator from using too much processor time.

 

However, at run time you can force Thread Validator to check for deadlocks or potential deadlocks in the application under test.

 

 

Forcing a potential deadlock check

 

If potential deadlock detection is on but the detection interval is set to a long time or to Never, you may wish to manually trigger a potential deadlock check:

 

menu Query menu instructionStep choose Potential deadlock detection instructionStep runs a potential deadlock check, updating displays accordingly

 

This menu option will only be enabled if the Potential Deadlocks option on the Detect settings tab is enabled.

 

 

Example

 

The example application can be used to demonstrate the deadlock checking:

 

1. Turn on the Potential Deadlocks option on the Detect settings tab

 

2. Set the Deadlock detect interval to Never (on the same setting page)

 

3. Launch the example application.

 

4. Use some of the built in tests to create a potential deadlock, for example the Potential deadlocks 2 thread.

 

5. Notice that Thread Validator does not register the potential deadlocks including for example, in the following three displays.

 

In the Errors panel of the Summary tab:

 

potential-deadlock-detection-example1

 

In the snapshots view of the Threads tab

 

potential-deadlock-detection-example3

 

Or in the All Locks tab:

 

potential-deadlock-detection-example2

 

6. Force a potential deadlock check as described above, and each of these displays will update to show the potential deadlocks found

 

In the Errors panel of the Summary tab, where the pink col-potdead bar indicates 2 potential deadlocks:

 

potential-deadlock-detection-example4

 

In the snapshots view of the Threads tab, where the thread snapshots now starts to register the threads as having potential deadlocks (pink col-potdead)

 

potential-deadlock-detection-example7

 

Or in the All Locks tab, where the locked threads are also now highlighted in pink:

 

potential-deadlock-detection-example5