[OCF] Event Notification API
Ragnar Kjørstad
linux-ha at ragnark.vestdata.no
Tue Apr 13 11:11:10 MDT 2004
On Tue, Apr 06, 2004 at 04:43:34PM -0700, John Cherry wrote:
> Hi folks,
> I'm looking around for a nice event notification api,
> and I couldn't help but notice
> http://www.opencf.org/cgi-bin/viewcvs.cgi/specs/event/Event.api?rev=1.4
> and the sample implementation of the 0.3 version of the spec at
> http://developer.osdl.org/dev/osdlclusters/
> and
> http://umn.dl.sourceforge.net/sourceforge/osdlcluster/osdlcluster_20020819.tgz
>
> I have a number of comments on the proposed API
> (e.g. "why the heck do you need oc_ev_event_done()?").
There are two different ways of processing events in the event
notification API. One is to pass control to the library
(oc_ev_handle_events) and have it call callback-functions and the other
is to do select/poll/whatever in the application and then run
oc_ev_get_event to retrieve events. The later is needed to do
select/poll on multiple sources in a single application.
oc_ev_event_done is needed to notify the messaging-library that the
processing of the event is complete in the oc_ev_get_event-case.
The notification is required because the library may have allocated
memory or in other ways have cleanup-work to do.
In the oc_ev_handle_events-case it was discussed if the return of the
callback-function should indicate that the datastructure could be freed
or not. You can probably find the full discussion in the archives, but
in short I believe the reason for using the explisit notification here
as well was consistency and flexibility to keep a reference to the event
even after returning from the callback.
--
Ragnar Kjørstad
Software Engineer
Scali - http://www.scali.com
High Performance Clustering
More information about the OCF
mailing list