From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oFPoDzDTQmLAJgAAgWs5BA (envelope-from ) for ; Tue, 29 Mar 2022 11:36:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id cA4KCTDTQmKLQAAAG6o9tA (envelope-from ) for ; Tue, 29 Mar 2022 11:36:48 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CCEBB2CBFC for ; Tue, 29 Mar 2022 11:36:47 +0200 (CEST) Received: from localhost ([::1]:35370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZ8HN-00036B-Ph for larch@yhetil.org; Tue, 29 Mar 2022 05:36:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZ8H0-00033v-EH for guix-devel@gnu.org; Tue, 29 Mar 2022 05:36:22 -0400 Received: from [2a02:1800:110:4::f00:19] (port=56938 helo=laurent.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nZ8Gy-0008JF-05 for guix-devel@gnu.org; Tue, 29 Mar 2022 05:36:21 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id C9cG2700b4UW6Th019cHHb; Tue, 29 Mar 2022 11:36:17 +0200 Message-ID: <9c53fc57b6e4d81b5b4447b5ed2d0797668a70ff.camel@telenet.be> Subject: Re: The Shepherd on Fibers From: Maxime Devos To: Philip McGrath , Ludovic =?ISO-8859-1?Q?Court=E8s?= , guix-devel@gnu.org Date: Tue, 29 Mar 2022 11:36:08 +0200 In-Reply-To: <4f889372-3464-92df-b350-b7c61e081f31@philipmcgrath.com> References: <87ee2sfg9d.fsf@inria.fr> <4f889372-3464-92df-b350-b7c61e081f31@philipmcgrath.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-3ebICBEw0/Z/Bl3+potZ" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1648546577; bh=OdW3lK8E4r+SypiB81zYUdqcsRMSMlfiD8HdwjlzxGk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=gcx2hzJjD/V4QkeZbff3VRA3WysThf/giOM2VuHh3ct8+Ix7/YfiMzl+UkCgIIL6s dU5c5qa4q/Bat4KedqX69XALmEm3qLCL7DqlRadSSEgHl5i4dmO/XGAUGmwJUjRl0M u6mke+Xfui12+7NDaLQ9cHQWdW9xeiwtFCw7gi99P2rW0rcHkfWlR7pWIAdoXxPoVW 3atDdzUqgBOlqBXQPdD0eYwXWNvVW503RUOYmRFQTF/ULvDOyNgXBMcDMJHkFri4+G hglJPvHTgoBvfnuUmJBtm+WhSvL/wVzlTq7Lp8GIYVhM07CjbPWix6ctqnxcrNMmvz Kbf2cxiMRcIQg== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:110:4::f00:19 (failed) Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.telenet-ops.be X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URI_DOTEDU=1.246 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list 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+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648546607; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=OdW3lK8E4r+SypiB81zYUdqcsRMSMlfiD8HdwjlzxGk=; b=sYub8wT1KSv4qmII5ODquwj2BIbtEzVkEasDroHwQc6AP+1t/OyBfbJKnwTa/uysKamfXS LOoeWuK9YQfFDgtgYCMdXatGe5Ph5YpA2E4uUoSYszORDZ/PNc4jBfjToj6qIzNaKhcYES pdlJdfRvj/J+/DVK+CdNxO4SAtEZd1s6XRAgKNSW4ITlPxGCFYN1m6P++J1z1rKPfxnjBc Y8dH4+sWK8HHHetm+viWgy0YPYHsyP+DPv+G5eg9SFarqmuVBX5myfJFHaNEhmMA3VX5TN V42+CwRTUE9d/Hyy8KxMsQrQrTlTVpHIMsXiEpzUiKITK0sy0S1z5XqEvBxQmQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648546607; a=rsa-sha256; cv=none; b=bGeisaCf43oxbpNFi5qPzv+b9bMxTYRYmFiursA3WtVWxvOMNxJD2LIZPqqDQdnukIepbx B93mWfPYbD44vXRzUbuzEadC9T8cDy5Fz2NYX8XRa2+iYFUGJiJLLKQGQaXtBIC4QXqSnr ySfSPKTAyP4ztIVdzcnrkSEdx1r66ci/Yj3pBr72VY19KEVZDdt7zbGTH15EPhuNVfHjoo NFGohfcqEULUekVNojjFMH0wCWLmC9n/MUCAtaMefLa72iJaKQO1XxWlJSf+4aDi7jeJYu 9V1oxzYBNt6yIhUZgpCz9B5U6G7tBoBrd7l1JKSHS6/q/urro7Qbk6icRaQkOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=gcx2hzJj; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 3.53 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=gcx2hzJj; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CCEBB2CBFC X-Spam-Score: 3.53 X-Migadu-Scanner: scn0.migadu.com X-TUID: pMf0tQ4FWG2F --=-3ebICBEw0/Z/Bl3+potZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Philip McGrath schreef op ma 28-03-2022 om 20:14 [-0400]: > Maybe it would be enough for this case for Fibers to provide variants of= =20 > `dynamic-wind` and/or `call-with-continuation-barrier` that cooperate=20 > with the Fibers implementation. I don't know if that would be possible= =20 > of not=E2=80=94in addition to my limited familiarity with Fibers, I have = not=20 > read all of the related literature that Alexis, Matthew, and Matthias=20 > Felleisen discuss in [5] and [6]=E2=80=94again, I am not an expert! Fibers' context switching is based on continuations. By definition, =E2=80=98call-with-continuation-barrier=E2=80=99 must create a continuation= barrier (and as a consequence, interfere with Fibers' context switching). It can be important to let 'call-with-continuation-barrier' (*) actually create a continuation barrier, even when fibers is used, e.g. to not create deadlocks (or livelocks or whatever, I don't know the terminology) when POSIX mutexes are used. As such, as-is, I don't think so. Unless Guile could add some kind of '#:key "foobar"' argument to 'call- wih-continuation-barrier' and 'call-with-prompt/abort-to-prompt' -- the idea is that, by default, a continuation barrier cannot be passed, unless a matching key is supplied. So you could have a continuation barrier that allows context switching, but not continuing with raise- continuable or amb. The unwind-protect defined at looks interesting, although it needs to be generalised to remove the global variables (for multi-threading) and it needs to be verified whether it interacts well with exeption handling. Greetings, Maxime. (*) Actually, 'call-with-continuation-barrier' and 'dynamic-wind' are already a bit of a lie, since the kernel ignores them when context switching ... Maybe continuation barriers and {un,re}winding is a matter of perspective? --=-3ebICBEw0/Z/Bl3+potZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkLTCBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kh/AQDKPRaUbzZMaOhxjOJw3MztYyKH ucTCA2U7vlSv+rBZfAD/Yy4e+QLk0RCfQZBKLIaj/2mGEcu8QwHj2e1MDLu/ugw= =7PTc -----END PGP SIGNATURE----- --=-3ebICBEw0/Z/Bl3+potZ--