[systemd-devel] sd_event_run
Lennart Poettering
lennart at poettering.net
Sun Apr 12 09:42:45 PDT 2015
On Sat, 11.04.15 23:52, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
> On Fri, Apr 10, 2015 at 06:14:40PM +0200, Lennart Poettering wrote:
> > On Sat, 14.03.15 12:19, Tom Gundersen (teg at jklm.no) wrote:
> >
> > > > 1. shouldn't SD_EVENT_PASSIVE become SD_EVENT_INITIAL? "passive" seems strange
> > > > in this context.
> >
> > I found it weird to name this INITIAL (or "INIT" or something like
> > that) since we would return to it every single iteration... For me
> > "init" kinda implies it's something "fresh", "unused", and hence not
> > really something we routinely come back to...
> In a sense it is "fresh" and "unused", because the state after doing
> an interation of the loop is exactly the same as if the loop never run.
> (E.g. I don't think it would be wrong to say "I cleaned the couch and
> restored it to its initial state", even though it obviously has been used.)
>
> "Passive" was confusing, so "initial", even if imperfect, seems an
> improvement. We really want to say "the state in which you started",
> without implying whether we have been there the whole time or not.
> I don't know if there's a better word.
glib calls the respective state "initial" btw... I didn't like the
name though, when I got inspiration from it...
> > > > Similarly, SD_EVENT_ARMED seems more self-explanatory than PREPARED.
> > > > (I don't like PREPARED because it is not obvious whether sources are
> > > > prepared to wait on, or events are prepared to be reaped.)
> >
> > I called this "prepared" since it what's _prepare() is supposed to get
> > into...
> >
> > But ARMED is fine too...
>
> We really should get some native speakers to help out with this :)
>
> Maybe sd_event_prepare should be renamed to sd_event_arm?
The "prepare" state I stole from glib:
https://developer.gnome.org/glib/unstable/glib-The-Main-Event-Loop.html
It's probably a good idea to not invent new naming here, if glib
already established the name. But then again, I departed from its
naming in the first place, as shown above, so I should probably shut
up... ;-)
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list