Re: Changing timezone without reboot/restarting each service?

From: David Chisnall <theraven_at_FreeBSD.org>
Date: Tue, 11 Nov 2014 08:56:47 +0000
On 11 Nov 2014, at 03:35, Allan Jude <allanjude_at_FreeBSD.org> wrote:

> jkh_at_ mentioned this specifically when he gave his talk at EuroBSDCon and
> MeetBSD, about how Apple solved this in LaunchD, because apparently
> originally libc DID check /etc/localtime constantly.

Darwin also has the notify(3) interface, which allows one-bit messages to be transmitted either from the kernel to userspace or from userspace to userspace very cheaply.  This is ideal for this sort of 'something you've cached is change, go and do something expensive to fix it' use (time zone has changed, network connectivity has changed, power state has changed).  You can assign notifications to either file descriptors (that can be monitored with kqueue), to signals, or to flags in memory for things where polling is cheaper (as in this case - the libc functions could just check whether a specific flag is set in memory when accessing the time zone info and load a newer one if changed).

David
Received on Tue Nov 11 2014 - 07:57:08 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:53 UTC