Robert Shearman wrote:
David D. Hagood wrote:



Unless the installer is using TryEnterCriticalSection, I would expect CPU utilisation to be 0% when deadlocking.

Yes, *once the deadlock occurs* the CPU drops to 0%. The issue (I think) is more along the lines of this:

On fast CPU:

thread 1 locks resource A, does something, locks B, unlocks B, unlocks A.

Thread 2 locks B, does something, locks A, does something, unlocks  C, A.

On slow machine:

Thread 1 locks resource A, does something.

Context switch.

Thread 2 locks B, does something.

Context switch

Thread 1 tries to lock B and blocks.

Context switch.

Thread 2 tries to lock A and blocks.

Deadlock.

In other words, on the fast CPU the deadlock does not happen because thread 1 gets everything done before thread 2 starts. On the slow machine, thread 2 starts while thread 1 is still doing stuff.



Reply via email to