From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlo Zancanaro Subject: Re: Improving Shepherd Date: Sat, 10 Feb 2018 06:50:07 +1100 Message-ID: <87inb6djtc.fsf@zancanaro.id.au> References: <871si8bc5g.fsf@zancanaro.id.au> <877errn23f.fsf@zancanaro.id.au> <871shzeg8m.fsf@gnu.org> <87d11jh1lv.fsf@zancanaro.id.au> <87y3k21egy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekEgi-00086t-PY for guix-devel@gnu.org; Fri, 09 Feb 2018 14:50:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekEgd-0001hg-PN for guix-devel@gnu.org; Fri, 09 Feb 2018 14:50:24 -0500 In-reply-to: <87y3k21egy.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hey Ludo, On Fri, Feb 09 2018, Ludovic Court=C3=A8s wrote: >> In particular, with higher levels of concurrency I want to move=20 >> the >> mutable state out of objects. > > The only piece of mutable state is the =E2=80=98running=E2=80=99 value. = We can=20 > make > that an =E2=80=9Catomic box=E2=80=9D, and users won=E2=80=99t even notice. That's not quite true, unfortunately. I count four pieces of=20 mutable state in the object: `running`, `enabled?`,=20 `waiting-for-termination?` and `last-respawns`. They should be=20 stored elsewhere so that Shepherd can manage that state however it=20 wants. We don't want to expose that to a user, where they could=20 break Shepherd's assumptions about when/how it's modified (because=20 user configuration can do anything it wants - including starting a=20 long-running thread to mutate it later). We shouldn't have to break much. My thought is just to remove=20 those mutable fields from the object (maybe leaving=20 `enabled?`, but changing its meaning slightly to just be whether=20 the service is enabled at the start). In practice it shouldn't=20 break any real-world configuration, I hope. Carlo --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAlp9+28ACgkQqdyPv9aw IbxUtw/+NuaZ2JL6RJpSv/my+OY4R2SYoWCvncSOgMjq+zfYW+V0WDeBVCe2sCNR Dh94M1HQVQjtq3K+MXBuSr29R5JayMqojToey/l2/CQV9zLVW7Z3sxfBxD7cDK65 RZ6cKsiMSGJVQAn/0ZpSIitl0JvXxYd7E9VPmvhLh2tQOUBPizglWUO6M6LiwTQt g2wWji8bM25l7QWI5numGrGx03uSHMDFx10iOEGmPITU4eOVRKWQLqdGsZ6Gve3U 3Aa/hu6Luqp/DtNrClDlN8rQHWnO0cE+rOetBAbQA3bYSQvUrb6m90NC1Ti3rlJX gwdybwizZ1gNLUW0rCORMEeV9ECO3YyLJeaN08Wn0Z32o2NyZQ0PMqDOkR/Dlf0J A9OzH6dqHD++OLKQAr4/hZZJLGCo32xIaP63J2eT8dxyIl9wnk1o0em8wB/3d6mL mObsIU1xSaqu4fwbcaJfRnP3ULfHewI6X7V0D5w+ifv9G+9jrrS1ooWdqtOl2oUh HJZ/3mpMmZEfhgn2VyfWDu8aGgzuRwXuyqr54kMn54VXWKQwb4c8jxJ+y5jB4Nxg 51r/MPNOwAoXWkUYLZvPlsh88IRmR5SCJTwesgopx/F6Lsvle4GvO6YmopJdeP5x uFZ9NdQYbyd1lrytryEXnv22ugGkJUC0ogqDsk0yp7ydJeHvOmA= =Lbfr -----END PGP SIGNATURE----- --=-=-=--