WaitForCritical Section.

Hi all,
I have one COM application which load the inproc components.
This component creates a lots of threads.
The problem with me is that I use SuspendThread to suspend some of the
threads which might be waiting
for some event to be triggered. And I am sure that there is a deadlock, but
i couldnt find it out.

The thread stack when observed in Windbg shows one of the threads stuck up
at
Waitforcriticalsection…But i couldnt find out the other thread which waits
on the same event.

The assembly code in the WaitforcriticalSection function shows

int 2e
ret

Could anyone tell me what int 2e does…

thanx
Manish

Int 2Eh is the system trap used for all system calls. Kernel32.dll calls
ntdll.dll that uses Int 2Eh to talk with NT’s kernel.

There is a detailed description at
http:

Niraj

“Sapariya Manish.j” wrote:
>
> Hi all,
> I have one COM application which load the inproc components.
> This component creates a lots of threads. The problem with me is that
> I use SuspendThread to suspend some of the threads which might be
> waiting for some event to be triggered. And I am sure that there is a
> deadlock, but i couldnt find it out.
>
> The thread stack when observed in Windbg shows one of the threads stuck
> up at Waitforcriticalsection…But i couldnt find out the other thread
> which waits on the same event.
>
> The assembly code in the WaitforcriticalSection function shows
>
> int 2e
> ret
>
> Could anyone tell me what int 2e does…
>
> thanx
> Manish</http:>

> The problem with me is that I use SuspendThread to suspend some of the

threads which might be waiting

Why use such a rough way? The thread will be possibly suspended while
holding locks - sure way to deadlock.
Use WaitForSingleObject on the event to suspend a thread.

Max

Also you can call KeEnterCriticalRegion to disable
normal kernel APCs or raise Irql to APC_LEVEL to
disable all APCs.

Thread suspending is done through the APC.
But I’m not sure if special or regular.

Paul

-----P?vodn? zpr?va-----
Od: Maxim S. Shatskih [SMTP:xxxxx@storagecraft.com]
Odesl?no: 30. ?ervna 2000 17:52
Komu: NT Developers Interest List
P?edm?t: [ntdev] Re: WaitForCritical Section.

> The problem with me is that I use SuspendThread to suspend some of the
> threads which might be waiting

Why use such a rough way? The thread will be possibly suspended while
holding locks - sure way to deadlock.
Use WaitForSingleObject on the event to suspend a thread.

Max


You are currently subscribed to ntdev as: xxxxx@sodatsw.cz
To unsubscribe send a blank email to $subst(‘Email.Unsub’)