Critical Section timeout

Critical Section timeout

Post by Carl Appello » Sun, 06 Oct 2002 05:15:01



I'm running into a process that's catching an exception
STATUS_POSSIBLE_DEADLOCK.  This seems to be raised by ntdll when an attempt
to acquire a Critical Section (EnterCriticalSection) times out.  On the
system I'm looking at, there are a couple of interesting internal settings
in ntdll.  These are:

RtlpTimoutDisable (set to 0)
RtlpTimeout (set to a large negative number representing 2 minutes worth of
time.)

My process is designed to wait forever to acquire a critical section, and
croaks after 2 minutes with the above settings.

On another system, I see these parameters set to:

RtlpTimoutDisable (set to 1)
RtlpTimeout (set to a large negative number representing 30 days.)

I vaguely recall a setup to debug CriticalSection deadlocks that modifies
the "normal" values for these parameters, setting a fairly short (2 minute)
timeout.  But I can't remember for the life of me seeing a reference to the
info.  Can anyone jog my memory?

Thanks,
Carl Appellof

 
 
 

Critical Section timeout

Post by Pavel Lebedinsk » Sun, 06 Oct 2002 07:18:28


The timeout is set here:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]
"CriticalSectionTimeout"=dword:00278d00

The value is in seconds.


> I'm running into a process that's catching an exception
> STATUS_POSSIBLE_DEADLOCK.  This seems to be raised by ntdll when an
attempt
> to acquire a Critical Section (EnterCriticalSection) times out.  On the
> system I'm looking at, there are a couple of interesting internal settings
> in ntdll.  These are:

> RtlpTimoutDisable (set to 0)
> RtlpTimeout (set to a large negative number representing 2 minutes worth
of
> time.)

> My process is designed to wait forever to acquire a critical section, and
> croaks after 2 minutes with the above settings.

> On another system, I see these parameters set to:

> RtlpTimoutDisable (set to 1)
> RtlpTimeout (set to a large negative number representing 30 days.)

> I vaguely recall a setup to debug CriticalSection deadlocks that modifies
> the "normal" values for these parameters, setting a fairly short (2
minute)
> timeout.  But I can't remember for the life of me seeing a reference to
the
> info.  Can anyone jog my memory?

> Thanks,
> Carl Appellof


 
 
 

Critical Section timeout

Post by arkady » Mon, 07 Oct 2002 19:53:55


Are you do TryEnterCriticalSection() before ?
Arkady


Quote:> I'm running into a process that's catching an exception
> STATUS_POSSIBLE_DEADLOCK.  This seems to be raised by ntdll when an
attempt
> to acquire a Critical Section (EnterCriticalSection) times out.  On the
> system I'm looking at, there are a couple of interesting internal settings
> in ntdll.  These are:

> RtlpTimoutDisable (set to 0)
> RtlpTimeout (set to a large negative number representing 2 minutes worth
of
> time.)

> My process is designed to wait forever to acquire a critical section, and
> croaks after 2 minutes with the above settings.

> On another system, I see these parameters set to:

> RtlpTimoutDisable (set to 1)
> RtlpTimeout (set to a large negative number representing 30 days.)

> I vaguely recall a setup to debug CriticalSection deadlocks that modifies
> the "normal" values for these parameters, setting a fairly short (2
minute)
> timeout.  But I can't remember for the life of me seeing a reference to
the
> info.  Can anyone jog my memory?

> Thanks,
> Carl Appellof

 
 
 

Critical Section timeout

Post by Carl Appello » Wed, 09 Oct 2002 03:33:51


Thanks to Pavel for the pointer to the registry setting.

My problems started after installing Windows 2000 SP3, which seems to have
changed my CriticalSectionTimeout from 30 days to 2 minutes!  Has anyone
else seen this change after installing W2K SP3 ?

Carl



> The timeout is set here:

> Windows Registry Editor Version 5.00
> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]
> "CriticalSectionTimeout"=dword:00278d00

> The value is in seconds.


> > I'm running into a process that's catching an exception
> > STATUS_POSSIBLE_DEADLOCK.  This seems to be raised by ntdll when an
> attempt
> > to acquire a Critical Section (EnterCriticalSection) times out.  On the
> > system I'm looking at, there are a couple of interesting internal
settings
> > in ntdll.  These are:

> > RtlpTimoutDisable (set to 0)
> > RtlpTimeout (set to a large negative number representing 2 minutes worth
> of
> > time.)

> > My process is designed to wait forever to acquire a critical section,
and
> > croaks after 2 minutes with the above settings.

> > On another system, I see these parameters set to:

> > RtlpTimoutDisable (set to 1)
> > RtlpTimeout (set to a large negative number representing 30 days.)

> > I vaguely recall a setup to debug CriticalSection deadlocks that
modifies
> > the "normal" values for these parameters, setting a fairly short (2
> minute)
> > timeout.  But I can't remember for the life of me seeing a reference to
> the
> > info.  Can anyone jog my memory?

> > Thanks,
> > Carl Appellof

 
 
 

1. synchronization: critical section and timeout

Hi, all!

I have two questions about windows critical section:
1.  Is it possible to attache a timeout to a critical section?
2. Since TryEnterCriticalSection is avaible only after Window
NT/windows2000, does it exist an alternative way to try lock a critical
section?

I know that mutex can do this job very well, however, comparing to a
critical section, it is less efficient. So if I have the positive answers of
the above two questions, I would prefere use critical section than mutex.
Maybe this suject has been well discussed somewhere, if it is this case,
please show me. thanks in advance.

regards,

-- Yang

2. pcmcia modem refinement?

3. Application takes 100% CPU on multiprocessor when Leaving a critical section and throwing an exception

4. HD's that work on the A1200 (Updated list 1.1)

5. multimedia timer and critical section question

6. Voice Recog

7. Critical Sections: Performance? Reliability?

8. Thoughts/Suggestions for WAN clock sync

9. critical section declared inside method

10. HELP - recieve exception because system critical section was not init

11. Critical Sections in Terminated DLL Threads

12. Exceptions using Critical Sections on NT 3.51

13. Right place for creating a global Critical Section