Christian Weisgerber <na...@mips.inka.de> wrote:

> On 2020-05-31, "Theo de Raadt" <dera...@openbsd.org> wrote:
> 
> >> > particular timecounter type can be supported.  My proposal would be to
> >> > implement a function *on all architecture* that takes the clockid as
> >> > an argument and returns a pointer to the function that implements
> >> > support for that timecounter.  On architectures without support, ir
> >> > when called with a clockid that isn't supported, that function would
> >> > simply return NULL.
> >> 
> >> Sure. All architectures will register their clocks with a unique ID in
> >> timetc.h, right? And then we do clockfun[clockid]() in libc, right?
> >
> > No, don't do that on every call -- instead, get the function pointer once.
> 
> Then you still need to check on every call whether the clockid has
> changed (because the kern.timecounter.hardware sysctl was changed)
> and refetch the function pointer in that case.

Then really, we should remove that sysctl support.

Because otherwise I don't see how it can work.  Aren't there deadlock
or spinning conditions?  Or at minimum, situtions where time won't flow
linearly.

All of that tweaking is junk working around bugs and incomplete software.

Reply via email to