From owner-freebsd-current@FreeBSD.ORG Tue Nov 11 16:10:19 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8CED273; Tue, 11 Nov 2014 16:10:19 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1 with cipher DES-CBC3-SHA (112/168 bits)) (Client CN "smtp.me.com", Issuer "VeriSign Class 3 Extended Validation SSL SGC CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BC69F9D; Tue, 11 Nov 2014 16:10:19 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-27.10(7.0.4.27.9) 64bit (built Jun 6 2014)) with ESMTPSA id <0NEV00L82U8L3TB0@st11p02mm-asmtp001.mac.com>; Tue, 11 Nov 2014 16:10:01 +0000 (GMT) Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: Changing timezone without reboot/restarting each service? From: Rui Paulo In-reply-to: <96024C48-850E-4511-94E5-C39E5A8AA77F@FreeBSD.org> Date: Tue, 11 Nov 2014 08:09:57 -0800 Content-transfer-encoding: quoted-printable Message-id: <101111B9-226C-4E74-9318-376A9DADC6D0@me.com> References: <5460B143.3010004@FreeBSD.org> <1415676518.1517572.189478341.09FB6AE5@webmail.messagingengine.com> <5461841F.9080208@freebsd.org> <96024C48-850E-4511-94E5-C39E5A8AA77F@FreeBSD.org> To: David Chisnall X-Mailer: Apple Mail (2.1990.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.28,0.0.0000 definitions=2014-11-11_03:2014-11-11,2014-11-11,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1408290000 definitions=main-1411110117 X-Mailman-Approved-At: Tue, 11 Nov 2014 16:25:15 +0000 Cc: freebsd-current@freebsd.org, Allan Jude X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2014 16:10:19 -0000 On Nov 11, 2014, at 00:56, David Chisnall wrote: >=20 > On 11 Nov 2014, at 03:35, Allan Jude wrote: >=20 >> jkh@ 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. >=20 > 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). Except that's not how it works for network events: kernel control = sockets are used to communicate between the kernel and userland about = the state of the network. Kernel control sockets carry kernel event = messages. -- Rui Paulo