From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: advice needed for multi-threading patch Date: Wed, 26 Aug 2009 23:12:55 -0400 Message-ID: References: <9DE0B828-815B-45DA-BD2B-0AB4DAD59CE2@raeburn.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251342795 20843 80.91.229.12 (27 Aug 2009 03:13:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Aug 2009 03:13:15 +0000 (UTC) Cc: Tom Tromey , Emacs development discussions To: Ken Raeburn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 27 05:13:08 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MgVQB-0007JM-3J for ged-emacs-devel@m.gmane.org; Thu, 27 Aug 2009 05:13:08 +0200 Original-Received: from localhost ([127.0.0.1]:43624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgVQA-0007Ez-65 for ged-emacs-devel@m.gmane.org; Wed, 26 Aug 2009 23:13:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgVQ6-0007ES-2d for emacs-devel@gnu.org; Wed, 26 Aug 2009 23:13:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgVQ1-0007AO-E0 for emacs-devel@gnu.org; Wed, 26 Aug 2009 23:13:01 -0400 Original-Received: from [199.232.76.173] (port=46467 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgVQ1-0007AF-Ai for emacs-devel@gnu.org; Wed, 26 Aug 2009 23:12:57 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:60925) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MgVQ0-0002YL-Le for emacs-devel@gnu.org; Wed, 26 Aug 2009 23:12:56 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As8EAF6WlUpFpYuS/2dsb2JhbACBU9ZmhBoFh2M X-IronPort-AV: E=Sophos;i="4.44,283,1249272000"; d="scan'208";a="44274731" Original-Received: from 69-165-139-146.dsl.teksavvy.com (HELO ceviche.home) ([69.165.139.146]) by ironport2-out.teksavvy.com with ESMTP; 26 Aug 2009 23:12:01 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id B9996B40F3; Wed, 26 Aug 2009 23:12:55 -0400 (EDT) In-Reply-To: <9DE0B828-815B-45DA-BD2B-0AB4DAD59CE2@raeburn.org> (Ken Raeburn's message of "Wed, 26 Aug 2009 14:50:36 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:114657 Archived-At: > Oh, right... I meant to ask you at some point if there was a reason for that > other than streamlining performance a little. It has nothing to do with performance, and everything to do with code cleanliness and robustness. Using Lisp_Symbol* rather than Lisp_Object makes it clear (both to the reader and to the type-checker) that the object received (or returned) can only be a symbol. > Now, with the GC work in progress, it's possible that during conservative > stack scanning, the pointer to the big structure might be enough to cause > it to not get freed up; I'm not that familiar with the new code. But the > conservative approach seems to be to keep the SCM (Lisp_Object) values live > as long as the pointed-to data is needed. Emacs's stack scanning already has to check both Lisp_Object values (i.e. tagged pointers) and plain direct untagged pointers. This was needed IIRC because even if the C code appears to hold on to a Lisp_Object value, the optimizer may get rid of it and only keep the untagged pointer. So, I think Guile's stack scanning will have to do that as well, I think (regardless of Emacs integration). > However, there's also the little matter that eventually I want to make Emacs > use Guile symbols for its own symbols, for better interaction between the > languages. That means that "struct Lisp_Symbol" would go away. If it's > part of the internal function interfaces, that means the Guile work has to > have greater divergence from the upstream code. We'll cross that bridge when we get there. I think we'll find that the particular interface used by the function will be a very minor issue (the whole function will probably need to be rewritten). Stefan