[Ace-users] Race condition between handle_input() & handle_timeout() in ACE_Svc_Handler ?

ShawnQ Shawn.Chain at gmail.com
Sun Nov 18 21:57:21 CST 2007

On 11月16日, 下午9时56分, schm... at dre.vanderbilt.edu (Douglas C. Schmidt)

> If you're using ACE_TP_Reactor you probably need to use an
> ACE_Thread_Mutex to serialize the processing between the various
> ACE_Svc_Handler methods.  There are some examples of how to do this
> sort of thing in the C++NP books <www.cs.wustl.edu/~schmidt/ACE/>.
Thanks for the reply doug,
I have synchronized the handler methods with a thread mutex. But my
problem is if I return -1 in the handle_timeout, other thread might
crash and seems it's using the handler.
And I also tried to use notify and return -1 inside handle_exception()
but no luck.
It seems that even I returned -1 in handler methods, and the handler
is released, ACE is still trying to distribute events to that
*destroyed* handler.

Is this a know bug in ACE5.4 or mis-use of "return -1' ?



More information about the Ace-users mailing list