Interprocess lock contention



Josh Sale
07-10-2005, 01:33 AM
I have a program where a single copy runs fine under Win2000, WinXP and
WinServer 2003. However, if two copies of the same program are run on the
same machine they single thread.

After adding some logging to the program, I've tracked the problem back to
contention associated with the clip board. The program uses the clipboard
(e.g., to place faces onto toolbar buttons) and it tries to save and then
restore any data placed on the clip board by the user when it does this.

The programs aren't deadlocked since when the first one finally completes
the second one takes off and runs to completion. But they are contending
with one another.

I'm hoping to find some kind of a Windows lock monitor that would show me
what resource (e.g., a mutex or semaphore) the second process is waiting for
during this situation. I think there may be another resource (probably COM
based) resource they are serializing on after the clip board.

Does anybody know of such a monitor? Or perhaps some other way to identify
this lock contention?

TIA,

josh


Interprocess lock contention