PDA

View Full Version : WCT (Wait chain traversal)



Setharian
01-09-2007, 08:20 PM
Hi everybody,

I was looking at a list of new features in Windows Vista and one of them caught my eye - wait chain traversal. It allows a programmer to detect many types of deadlocks in an application. This can simplify multi-threaded application development by a great deal. Searching for "WCT"+"Delphi" returned no results (as well as many other search keyword combinations) so I decided to write an unit which would make use of this new functionality and automaticly try to detect deadlocks and report that. However there is a problem - I don't have Windows Vista. Nonetheless I've managed to write a proto unit even without the possibility to test it and I'm almost 100% sure it will work. If somebody here has Windows Vista he could test it and possibly come up with some ideas how to improve it. I've uploaded a package containing the WCT unit and a testing application with a simple deadlock.

The link to the package: http://filebeam.com/1eb8f466207ccfe7b223f199007ba2ec

chronozphere
01-09-2007, 09:05 PM
I have vista ultimate here, but i dont know anything about multi-theaded programs, so i don't know the concept of WCT. I also don't know what the sample app should output.

I got this output:

Deadlock detection active.

**The following block is added about every 5 seconds**

Thread [PID 00001700 TID 00000784] - Blocked
Thread wait
Thread [PID 00001700 TID 000015B0] - Blocked
Critical section
Thread [PID 00001700 TID 00000784] - Blocked

Hope to have helped you. ;)

arthurprs
01-09-2007, 09:18 PM
i don't use vista ;/

Setharian
01-09-2007, 09:45 PM
The output looks to be what I have expected.

The output says this:
Thread $784 is waiting for thread $15B0 to end.
Thread $15B0 is waiting for a critical section owned by thread $784.
Deadlock (both threads are stuck, waiting for each other).

Thank you for testing.

chronozphere
01-09-2007, 10:41 PM
no problem. I'm glad to have helped you ;)