Re: gnome-session proposal
- From: Lennart Poettering <mztabzr 0pointer de>
- To: desktop-devel-list gnome org
- Subject: Re: gnome-session proposal
- Date: Thu, 26 Jun 2008 02:24:13 +0200
On Wed, 25.06.08 20:00, William Jon McCann (mccann jhu edu) wrote:
Hey!
> >> 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
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]