[Openais] corosync trunk - fix null dispatch handlers

Steven Dake sdake at redhat.com
Fri Apr 2 09:19:05 PDT 2010


On Fri, 2010-04-02 at 09:31 +0200, Jan Friesse wrote:
> Steve,
> this one will change behavior for (dispatch_types == CS_DISPATCH_ONE). 
> Original behavior:
> - Message received
> - Callback is not registered -> continue AND WAIT for another message
> - Loop until at least one callback is called
> 
> New behavior:
> - Message received
> - Callback is not registered -> break and stop loop -> return to app, 
> but without ANY action.
> 
> Question is, what behavior is correct, more logic? From my point of 
> view, original one.
> 

Well original implementation led to deadlock, of the dispatch routine,
but a patch that tracks actual dispatches and uses that as the basis for
determining if DISPATCH_ONE should continue would be helpful :-)

The model of DISPATCH_ONE is it should dispatch a callback if one is
available, but if none are available, it shouldn't block....  In the
case of a null callback, it should probably try to dispatch atleast one
callback, but not block in the process.

Regards
-steve

> Regards,
>    Honza
> 
> 
> Steven Dake napsal(a):
> > If a dispatch handler is undefined, the C compiler automatically defines
> > it to NULL. This is intended behavior.  The dispatch functions check
> > whether the value is NULL (meaning no action should be taken from the
> > library point of view) and call "continue".  This doesn't trigger the
> > dispatch_put operation locking up the cpg dispatch operations.  Instead
> > "break" should be called to exit the switch and allow normal processing
> > of the dispatch functions.
> > 
> > Regards
> > -steve
> > 
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > Openais mailing list
> > Openais at lists.linux-foundation.org
> > https://lists.linux-foundation.org/mailman/listinfo/openais
> 



More information about the Openais mailing list