Re: supporting notifications from backends



Hi,

On Wed, 2004-03-31 at 14:46, Dave Cridland [Home] wrote:

> > > Also I'm a little unclear on how threading might or might not work -
> > > could I call the notify function from any thread, or am I best off
> > > processing notifications whether the backend is called?
> > 
> > 	No, notifying from another thread isn't safe. You should invoke the
> > notification from the main thread.
> 
> So presumably, on every call into the backend, I'd need to check for
> notifications that need sending? How often, typically, does a backend
> get called? I suppose sync_all gets called if nothing else.

	Just queue an idle handler on the default glib mainloop and invoke the
notification from there.

Cheers,
Mark.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]