[Ace-users] [ace-users] RE : RE : RE : Notify in handle_signal

Chris Cleeland cleeland at ociweb.com
Tue Feb 12 10:16:40 CST 2008

On Feb 12, 2008, at 7:46 AM, ZXERASOGE002, Ext wrote:

> In my case I don't care if I miss a few notifications when the pipe is
> not empty because I have a loop over waitpid in handle_exception.  
> But in
> handle_signal I must be sure I call notify when the pipe is empty. One
> solution would be to check in handle_signal if there is something to
> read from the notification pipe (with a select for instance), and call
> notify *only* when there is nothing to read (ie the pipe is empty).  
> The
> problem is the notification_pipe is protected and not public

Don't you still have a race condition where the pipe fills between the  
time you check for empty and the time you actually try to write?  I  
realize that's pathological and fairly unlikely, but it doesn't sound  

As far as gaining access to the notification_pipe, it's been awhile  
since I've mucked around with reactor internals, but couldn't you  
specialize the implementation (Select_Reactor or Select_Reactor_T) and  
override notify() with your own implementation that does what you want?

Chris Cleeland, Principal Software Engineer
http://www.theaceorb.com AND http://www.ociweb.com

More information about the Ace-users mailing list