Re: supporting notifications from backends



Hi David,

On Mon, 2004-03-29 at 22:38, Dave Cridland [Home] wrote:
> On Thu, 2004-03-25 at 17:54, Mark McLoughlin wrote:
> >   + Added a FIXME to source_notify_cb(). Basically, we should be able to
> >     prevent notifying the client of a change if the change won't 
> >     actually cause the client to see a different value. I'm going to try
> >     and get the patch in #88829 merged soon too and we should be able to
> >     re-use some of that to fix this. See gconf_sources_is_affected() in
> >     the patch with that bug.
> 
> Comparing the above with:
> 
> > +Note, the backend should <emphasis>not</emphasis> notify the daemon of
> > +any changes that originated from the daemon itself.
> 
> suggests to me that "should <emphasis>not</emphasis>" is equivalent to a
> RFC2119/BCP14 "SHOULD NOT", rather than a "MUST NOT".
> 
> Am I right? Some backends may have to increase complexity in order to
> figure out whether the notification is due to their own change, and the
> FIXME should catch this case anyway.

	Yeah, pretty much. Obviously, its better if backends catch this
themselves, though. It should be straightforward in most cases.

> 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.

Cheers,
Mark.




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