From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.devel Subject: Re: Ephemerons, self-referentality in weak hashtables Date: Wed, 08 Sep 2021 22:11:31 +0200 Message-ID: References: <87vb9ihy6x.fsf@igalia.com> <87czto11vd.fsf@dustycloud.org> <4ddb8c54cdbdcaf1644ce07bb5cad261ebb86600.camel@telenet.be> <8b9906861b138901e0ed17f640506d70a686ec51.camel@telenet.be> <87fsuf9h1f.fsf@dustycloud.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-J8TQQT0gziux6vj6YWbN" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15079"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.34.2 Cc: Andy Wingo , guile-devel@gnu.org To: Christine Lemmer-Webber Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Sep 08 22:11:57 2021 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mO3vI-0003gF-LB for guile-devel@m.gmane-mx.org; Wed, 08 Sep 2021 22:11:56 +0200 Original-Received: from localhost ([::1]:34294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mO3vG-0007Pr-H9 for guile-devel@m.gmane-mx.org; Wed, 08 Sep 2021 16:11:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mO3v5-0007PV-Kc for guile-devel@gnu.org; Wed, 08 Sep 2021 16:11:43 -0400 Original-Received: from michel.telenet-ops.be ([2a02:1800:110:4::f00:18]:58180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mO3v3-0002rJ-9H for guile-devel@gnu.org; Wed, 08 Sep 2021 16:11:43 -0400 Original-Received: from butterfly.local ([188.188.194.186]) by michel.telenet-ops.be with bizsmtp id rYBc2500H41m7uc06YBdkN; Wed, 08 Sep 2021 22:11:38 +0200 In-Reply-To: <87fsuf9h1f.fsf@dustycloud.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1631131898; bh=D3GBxFUmTc1qMJtt2OZR9GjrMcTKky1tyutTAFF3hOA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=lV8fA92XIKESz4k4b53RAqxld5tkLDT23yOOnAwhc28hUimSuc6z6nkeY0eOWto7R LUlv6tMkEBFncTwmUxb69MhersesK0wyHugrwHZ6vHJK3IzZkX+AhjBxQ6n3VUnlkS MMlIFBgGvpnFTJPsCgJTSnSE/OpgwIzt5jbZ+RapzMlYXaGHFBH6y7/htLOvurVJWI WH/amj2ygtt1thmdofQvIU0hp5poy3+PsRyiDiC5kEn9QEtjfPvXCKbk9PiQM1AEnU PtS0b5GGAEdaX5qGigHQMfMXwCQG1mOC4tYFxRfWRY2MdZ+TsNXGXyI5QUlI6kEOk0 hU5hSXXi5hj/A== Received-SPF: pass client-ip=2a02:1800:110:4::f00:18; envelope-from=maximedevos@telenet.be; helo=michel.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20848 Archived-At: --=-J8TQQT0gziux6vj6YWbN Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Christine Lemmer-Webber schreef op wo 08-09-2021 om 12:18 [-0400]: > Maxime Devos writes: >=20 > > [[PGP Signed Part:Undecided]] > > Maxime Devos schreef op zo 20-06-2021 om 17:01 [+0200]: > > > Christopher Lemmer Webber schreef op di 18-05-2021 om 11:46 [-0400]: > > > > Hello, > > > >=20 > > > > I'm finally taking some time to port Goblins to Guile, in-between o= ther > > > > tasks anyway. In Goblins there is a weak hashtable that maps curre= nt > > > > actor references to their current behavior. I found that for > > > > self-referential actors, I needed ephemerons for GC stuff to work r= ight. > > >=20 > > > [bla bla on how this could be implemented in Guile] > >=20 > > This doesn't work because there is nothing preventing the > > 'value' from being freed. Trying to fix that now, using > > the example implementation of "weak maps" in libgc. > >=20 > > Greetings, > > Maxime. >=20 > I fell off the radar on replying to this, but did path turn out to work? The example implementation was a bit complicated and not well-documented. The =E2=80=98disclaimer=E2=80=99 support is disabled by default, a configur= ation flag needs to be set while compiling libgc to use disclaimers. Guix (the distro= I use) doesn't set it. I needed to be careful in libguile/weak-table.c to no= t protect too much (otherwise it wouldn't be an ephemeral weak hash table) or too little (otherwise =E2=80=98freed=E2=80=99 objects would be re-used). I think it can be made to work, but I didn't succeed, and moved on to other things. If someone would like to implement this, I would recommend startin= g with something like =E2=80=98ephemeral pairs=E2=80=99 before moving to ephe= meral hash tables. Greetings, Maxime. --=-J8TQQT0gziux6vj6YWbN 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+4iGRcl7gUCYTkY9BccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pdTAQDIkeCyR0NV+RGnph9/6uwx9WEU 2jH5KbDExGhfQF7OkAEA0zFRVNk79w4MYSdL7O7QKsblm+dyz/vKLZIYmFD9UQ0= =V29h -----END PGP SIGNATURE----- --=-J8TQQT0gziux6vj6YWbN--