From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludovic.courtes@laas.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: thread cancellation, take 2 Date: Mon, 24 Sep 2007 13:42:56 +0200 Organization: LAAS-CNRS Message-ID: <87k5qg2ssf.fsf@laas.fr> References: <2bc5f8210709200730q61d7973ft8d1da14889efb2f1@mail.gmail.com> <87abrhl604.fsf@laas.fr> <2bc5f8210709200836i1267bcc8qa066b4d27f2c3e2@mail.gmail.com> <2bc5f8210709222216rf7aa8ednd380fa8db2975073@mail.gmail.com> <87vea1oe70.fsf@chbouib.org> <2bc5f8210709231139x4ed56fc4q9ae28afdb707457b@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1190634193 28110 80.91.229.12 (24 Sep 2007 11:43:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 24 Sep 2007 11:43:13 +0000 (UTC) Cc: guile-devel@gnu.org To: "Julian Graham" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Sep 24 13:43:09 2007 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.50) id 1IZmLF-0005Ub-2x for guile-devel@m.gmane.org; Mon, 24 Sep 2007 13:43:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZmLC-0000ml-AG for guile-devel@m.gmane.org; Mon, 24 Sep 2007 07:43:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IZmL9-0000m4-Ic for guile-devel@gnu.org; Mon, 24 Sep 2007 07:43:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IZmL8-0000lo-42 for guile-devel@gnu.org; Mon, 24 Sep 2007 07:43:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZmL7-0000ll-Ug for guile-devel@gnu.org; Mon, 24 Sep 2007 07:43:01 -0400 Original-Received: from laas.laas.fr ([140.93.0.15]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IZmL7-0005dF-8Z for guile-devel@gnu.org; Mon, 24 Sep 2007 07:43:01 -0400 Original-Received: from messiaen.laas.fr (messiaen [IPv6:2001:660:6602:0:230:65ff:fed4:9d20]) by laas.laas.fr (8.13.8/8.13.8) with SMTP id l8OBgu7q029892; Mon, 24 Sep 2007 13:42:56 +0200 (MEST) Original-Received: by messiaen.laas.fr (sSMTP sendmail emulation); Mon, 24 Sep 2007 13:42:56 +0200 X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 3 =?iso-8859-1?Q?Vend=E9miaire?= an 216 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: powerpc-unknown-linux-gnu Mail-Followup-To: "Julian Graham" , guile-devel@gnu.org In-Reply-To: <2bc5f8210709231139x4ed56fc4q9ae28afdb707457b@mail.gmail.com> (Julian Graham's message of "Sun\, 23 Sep 2007 14\:39\:17 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Spam-Score: -0.001 () NO_RELAYS X-Scanned-By: MIMEDefang at CNRS-LAAS on IPv6:2001:660:6602::2 X-Detected-Kernel: 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:6811 Archived-At: Hi, "Julian Graham" writes: > What's useful about this is that you can have several resources at > different levels of nesting that need to be cleaned up at cancellation > time, but you only need to worry about pushing and popping handlers > within your own scope. If people feel that managing the entire list > at once is more Scheme-y, though, I can change it. I find it more elegant to use closures to that end. I.e., when installing a handler, you'd write something like this: (let ((cleanup (thread-cleanup-procedure (current-thread)))) (set-thread-cleanup-procedure! (current-thread) (lambda () ;; invoke previous handler (if (procedure? cleanup) (cleanup)) ;; clean up... ))) There's a race here in case multiple threads try to change the cleanup procedure associated with that particular thread at the same time, but I suppose it is not an issue in practice. > Great -- I'll deal with the paperwork, add tests, and clean up the > code as you've suggested. I'll send the revisions to you offline, if > that's okay. Please post updated patches on the list as well so others get a chance to review them. Thanks! Ludovic. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel