> Date: Fri, 16 Sep 2016 16:03:50 +0200 > From: Vincent Gross <vgr...@openbsd.org> > > On Thu, 15 Sep 2016 16:29:45 +0200 > Martin Pieuchot <m...@openbsd.org> wrote: > > > After discussing with a few people about a new "timed task" API I came > > to the conclusion that mixing timeouts and tasks will result in: > > > > - always including a 'struct timeout' in a 'struct task', or the > > other the way around > > or > > > > - introducing a new data structure, hence API. > > > > Since I'd like to keep the change as small as possible when converting > > existing timeout_set(9), neither option seem a good fit. So I decided > > to add a new kernel thread, curiously named "softclock", that will > > offer his stack to the poor timeout handlers that need one. > > > > With this approach, converting a timeout is just a matter of doing: > > > > s/timeout_set/timeout_set_proc/ > > > > > > Diff below includes the conversions I need for the "netlock". I'm > > waiting for feedbacks and a better name to document the new function. > > > > Comments? > > Reads OK; I like the simple renaming. > > The "softclock" thread name will be confusing, the timeouts are indeed > driven by the softclock interrupt, but the tasks have nothing to do > with softclock. Maybe "timeothread" ?
Naming things is always hard. The :"thread" in the name is a bit redundant. Probably just "timeout" would be fine. The nice thing about "sofclock" is that it is nicely symmetric with the "softnet" thread. Although that one is a taskq.