Re: gnome-session proposal

On Wed, 25.06.08 20:00, William Jon McCann (mccann jhu edu) wrote:


> >> We can still support applications that only know if they should
> >> inhibit "just in time" by emitting a signal when a logout is
> >> requested.  The applications can then take an inhibit in response to
> >> that signal.
> >
> > This part sounds racy. Is it?
> It is.  Logout is a racy proposition.  We should strongly recommend
> that people use the Inhibit API.

Nah, it doesn't have to be racy. Since you know all your clients, you
can make sure everyone received your "i am about to shut down", by
requiring them to respond with an ack. If they all responded you go
on. If some process didn't respond in 2s or so, you assume it is bad
behaving, and ignore it. Between the time the clients received the
broadcast until they send you the ack back they have time to call the
Inhibit() function if they want to. Race is gone, and the protocol is
only a tiny bit more complex: you need to wait until all clients
respond back to you, 2s at max. 


Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553           GnuPG 0x1A015CC4

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