Questions about the Backend Interface

Dave Peticolas dave@krondo.com
Tue, 06 Mar 2001 15:13:24 -0800


Derek Atkins writes:
> Dave Peticolas <dave@krondo.com> writes:
> 
> > > If so, then we just need something like:
> > > 	void gncSetEventFlag (void);
> > > 
> > > and the Backend method can be something like:
> > > 	void (*process_event) (Backend *be);
> > 
> > Ok, I will work on adding this today.
> 
> Ok.  We should probably also have a'ClearEventFlag()' for when the
> event(s) get handled.
> 
> Also, do you plan to make this MT-Safe, or should a multi-threaded
> backend use a mutex around these functions?  I don't really care
> either way.  I'm kind of thinking that the backend might want to
> handle the locking itself, because it will need to lock the
> event-staging-area anyways.

How about we make the 'are there events pending' call a part of the
backend api as well. So the engine/gui would just ask the backend if
there are events and the backend would clear the flag when they are
handled. That way, backends which need to implement mutexes can do so
and the rest don't need to.

dave