From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Fluids Date: Sun, 14 Feb 2010 15:32:30 +0100 Message-ID: <87eiknx4zl.fsf@gnu.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1266158162 17211 80.91.229.12 (14 Feb 2010 14:36:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Feb 2010 14:36:02 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Feb 14 15:35:57 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NgfZj-0005O2-M0 for guile-devel@m.gmane.org; Sun, 14 Feb 2010 15:35:55 +0100 Original-Received: from localhost ([127.0.0.1]:43168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NgfZj-00013A-4d for guile-devel@m.gmane.org; Sun, 14 Feb 2010 09:35:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NgfXY-00006E-QU for guile-devel@gnu.org; Sun, 14 Feb 2010 09:33:40 -0500 Original-Received: from [140.186.70.92] (port=41635 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NgfXY-0008PB-91 for guile-devel@gnu.org; Sun, 14 Feb 2010 09:33:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NgfWq-0002FQ-1l for guile-devel@gnu.org; Sun, 14 Feb 2010 09:33:00 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:41810) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NgfWp-0002FM-QN for guile-devel@gnu.org; Sun, 14 Feb 2010 09:32:56 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NgfWn-0003bx-8n for guile-devel@gnu.org; Sun, 14 Feb 2010 15:32:53 +0100 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 14 Feb 2010 15:32:53 +0100 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 14 Feb 2010 15:32:53 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 26 =?iso-8859-1?Q?Pluvi=F4se?= an 218 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:/6RqjmpIUSFffU8mqam2sJ/Occ0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9978 Archived-At: Hi Andy! Andy Wingo writes: > But you can't / shouldn't make a new fluid every time you enter a > `catch', because currently fluids are never garbage collected! We really > need to fix this. I think it's a 1.9 regression. Indeed. We should use a weak vector or some such instead of the current scm_gc_malloc’d array. > To do so effectively, I think you'd need to make fluid objects store > their values directly, so that the GC doesn't have to go through hoops > to know that they're collectable. Ideally they would get their values > via pthread_getspecific; but that would defeat some bits of ours about > "dynamic states" (not a very useful concept IMO), and the GC would need > help. Actually it would be nice if libgc supported thread-local > allocations. (Does it?) I think dynamically allocating thread-local storage can only be done with pthread_key_create (). Libgc knows how to scan pthread keys. So we could have fluids be wrappers around pthread keys and fluid-ref would boil down to pthread_getspecific (). Then we wouldn’t even need the fluid number hack. Is it what you had in mind? Thanks, Ludo’.