From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: catch, throw, prompt, control, fluids, garbage collection Date: Mon, 15 Feb 2010 23:07:40 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1266271608 23057 80.91.229.12 (15 Feb 2010 22:06:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Feb 2010 22:06:48 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Feb 15 23:06:43 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 1Nh95W-0008Hd-50 for guile-devel@m.gmane.org; Mon, 15 Feb 2010 23:06:42 +0100 Original-Received: from localhost ([127.0.0.1]:44645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nh95V-0008BC-Iq for guile-devel@m.gmane.org; Mon, 15 Feb 2010 17:06:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nh95T-0008B7-9Y for guile-devel@gnu.org; Mon, 15 Feb 2010 17:06:39 -0500 Original-Received: from [140.186.70.92] (port=50007 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nh95S-0008Az-La for guile-devel@gnu.org; Mon, 15 Feb 2010 17:06:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nh95R-0000Gm-PW for guile-devel@gnu.org; Mon, 15 Feb 2010 17:06:38 -0500 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:55305 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nh95R-0000C7-MI for guile-devel@gnu.org; Mon, 15 Feb 2010 17:06:37 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id E872098F8C for ; Mon, 15 Feb 2010 17:06:15 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=1Oa2W5DYyJyDQDovA64cUTr2h64=; b=hb9WYW GPxpFuHr6T2LtVVGL/A92HoyscncoUsbeN22VP9NNcMl8QBzo7qHFqporlz/ylIK yTk+dzZMdFgqxGW9V3N9FhwnhSbACxE0OaP3K0W4HQrDnIUqyg+3cuUTwsy4j0Wg YVGhwCRMrdYZgXKwUtxmrDjXwbLXANLx1vTLE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=IjezMzr6m6stwGtoIKHh4mJckmZNzIa0 /hWDDN+YrkEgJX8/Ld6HwLMNZ80Vs7uQrgC+rmuYqmM6bHHStVVudulw4Ed82hqD gVEGF25yk90gzGQzDJAYOo4pwlJvFyDbA9qRx/ibVrqXiPoIES2LCRawnDQX2CE+ Q9xWNxCTs+Y= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id E343198F8B for ; Mon, 15 Feb 2010 17:06:15 -0500 (EST) Original-Received: from unquote (unknown [81.39.162.84]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 29CC798F88 for ; Mon, 15 Feb 2010 17:06:14 -0500 (EST) In-Reply-To: (Andy Wingo's message of "Sun, 14 Feb 2010 13:33:42 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: 563693E8-1A7E-11DF-BE4D-6AF7ED7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) 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:9988 Archived-At: Hi, A brief note. On Sun 14 Feb 2010 13:33, Andy Wingo writes: > I am currently shaving a yak. I wrote more about the yak: http://wingolog.org/archives/2010/02/14/sidelong-glimpses In it I concluded, I need an efficient with-fluids, some pieces of prompt and abort, and to add that all to the bootstrap language of Guile, and I have it. So, regarding fluids: > The problem: Well, you might want to set some exception handlers, and > then spawn a bunch of threads all with those handlers. But if a > pre-unwind handler throws an exception, that exception shouldn't be > handled by itself, or you get an infinite loop. Basically you need a bit > to say whether a given handler is running in a given thread or not -- a > fluid. It should probably be thread-local, but it doesn't need to be per-exception-handler -- a thread-local weak hash or even a list would be fine. At the same time, I came to the conclusion that Guile's current implementation of fluids is best. With Emacs we really want shallow binding, and we can store a pointer to the fluid vector (dynamic state) in the VM's data itself, so accessing fluids can be quite fast. It will need to be documented that currently fluids can't be collected, and if users need collectable fluids, they should use an indirection (like a fluid containing a weak key hash table). See also: http://www.gnu.org/s/emacs/manual/html_node/elisp/Impl-of-Scope.html and http://www.franz.com/support/documentation/8.0/doc/multiprocessing.htm#wide-binding-1. I'm close to having the problem solved, but it will take another couple weeks. Also I haven't gotten to NEWS this evening. Sorry! Ciao, Andy -- http://wingolog.org/