[Ace-users] [ace-bugs] [ace-users] Thread_Timer_Queue_Adapter deadlock
jwillemsen at remedy.nl
Fri Feb 15 02:18:17 CST 2008
There is an ACE_Reverse_Lock you could use for this. The question would be
whether this doesn't cause other side effects, can you store this issue in
bugzilla (see http://deuce.doc.wustl.edu/bugzilla/index.cgi)
2650 AC Berkel en Rodenrijs
www.theaceorb.nl / www.remedy.nl
*** Integrated compile and test statistics see
*** Commercial service and support for ACE/TAO/CIAO ***
*** See http://www.theaceorb.nl/en/support.html ***
> > SAMPLE FIX/WORKAROUND:
> > ACE_Thread_Timer_Queue_Adapter should unlock its internal mutex
> > calling expire.
> Actually, this alone turns out to not be enough to fix the problem,
> because the thread-safe version of ACE_Timer_Heap and I presume all
> other ACE_Timer_Queue implementations have an identical potential
> deadlock of their own.
> See attached test program that produces the deadlock without the
> Thread_Timer_Queue_Adapter. If you change the '#if 0' at the top to
> use ACE_SYNCH_NULL_MUTEX with ACE_Timer_Heap, the deadlock goes away.
> If you change ACE_Thread_Timer_Queue_Adapter as per the attached diff,
> *and* parameterize it on the ACE_SYNCH_NULL_MUTEX versions of
> ACE_Timer_Heap, no deadlocks.
> diff --git a/ace/Timer_Queue_Adapters.cpp
> index 5876ee2..0e24dab 100644
> --- a/ace/Timer_Queue_Adapters.cpp
> +++ b/ace/Timer_Queue_Adapters.cpp
> @@ -278,8 +278,13 @@ ACE_Thread_Timer_Queue_Adapter<TQ>::svc (void)
> + // Unlock the mutex to prevent deadlock
> + mutex_.release ();
> // Expire timers anyway, at worst this is a no-op.
> this->timer_queue_->expire ();
> + mutex_.acquire ();
> // Thread cancellation point, if ACE supports it.
> Caleb Epstein
More information about the Ace-users