KTHREAD wait blocks

Hi,

I find myself debugging a lot of deadlocks these days. I have a working
assumption that each of the four consecutive wait blocks in the KTHREAD
structure correspond to a particular kind of dispatcher object i.e. mutex,
event, semaphore and timer. Is this a correct assumption and if so does
anybody know which wait block corresponds to which kind of dispatcher
object. If this is a false assumption can somebody tell me what each of
these wait blocks are used for.

And while I am here - does anybody know what the SuspendSemaphore wait
block is used for, specifically.

Thanks in advance.

Douglas.

The assumption is at least partially incorrect.

The KTHREAD does contain four preallocated wait blocks. Three are for
general use (from callers to KeWaitForMultipleObjects) but the fourth is
reserved for the timer used to implement “wait with timeout”. Callers
of KeWaitForMultipleObjects with more than three wait objects must
actually allocate and pass their own wait block storage.

The structure and usage of those waitblocks is not predetermined,
however. If you are detecting patterns within the specific
implementation, you should not count on this remaining constant over
time.

I’m not sure what the SuspendSemaphore wait block is. I know what the
SuspendSemaphore is, but as far as I know there is no special wait block
that corresponds with it. SuspendSemaphore is used when a thread is
“frozen” or suspended - threads can even be started in suspended state.
They wait until all other code paths requesting thread suspension
release them (hence, the use of a semaphore).

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Douglas G. Hanley
Sent: Monday, February 07, 2005 4:06 AM
To: Kernel Debugging Interest List
Subject: [windbg] KTHREAD wait blocks

Hi,

I find myself debugging a lot of deadlocks these days. I have a working
assumption that each of the four consecutive wait blocks in the KTHREAD
structure correspond to a particular kind of dispatcher object i.e.
mutex,
event, semaphore and timer. Is this a correct assumption and if so does
anybody know which wait block corresponds to which kind of dispatcher
object. If this is a false assumption can somebody tell me what each of
these wait blocks are used for.

And while I am here - does anybody know what the SuspendSemaphore wait
block is used for, specifically.

Thanks in advance.

Douglas.


You are currently subscribed to windbg as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com