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 15:18:06 -0400 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 1251316217 17447 80.91.229.12 (26 Aug 2009 19:50:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Aug 2009 19:50:17 +0000 (UTC) Cc: Emacs development discussions To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 26 21:50:10 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 1MgOVV-0001Hg-Mu for ged-emacs-devel@m.gmane.org; Wed, 26 Aug 2009 21:50:10 +0200 Original-Received: from localhost ([127.0.0.1]:58861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgOVV-0003UY-6c for ged-emacs-devel@m.gmane.org; Wed, 26 Aug 2009 15:50:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgO0b-0004i4-AX for emacs-devel@gnu.org; Wed, 26 Aug 2009 15:18:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgO0W-0004ca-5C for emacs-devel@gnu.org; Wed, 26 Aug 2009 15:18:12 -0400 Original-Received: from [199.232.76.173] (port=42407 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgO0V-0004cN-R6 for emacs-devel@gnu.org; Wed, 26 Aug 2009 15:18:07 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:64921 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MgO0V-0005vL-IU for emacs-devel@gnu.org; Wed, 26 Aug 2009 15:18:07 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au4EABAnlUpFpYuS/2dsb2JhbACBU9dMhBoFh2M X-IronPort-AV: E=Sophos;i="4.44,281,1249272000"; d="scan'208";a="44248962" 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 15:17:13 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id EA816B40F3; Wed, 26 Aug 2009 15:18:06 -0400 (EDT) In-Reply-To: (Tom Tromey's message of "Wed, 26 Aug 2009 09:31:34 -0600") 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:114629 Archived-At: > I'm trying to properly implement per-thread let binding in the presence > of buffer-local variables. The problem with that is that we first need to figure out what its semantics should be. And to me the semantics of a let-bound buffer-local variable is very much unclear in the presence of threads (it's already pretty messy even without threads). So I'd rather disallow other threads from accessing this buffer's variable while the let-binding is active. > I was planning to do this by inserting a thread-based lookup anywhere a > buffer-local was accessed. However, to do this, I need to insert a > function call anywhere a field corresponding to a DEFVAR_PER_BUFFER is > used. > So, e.g., I would like to change: b-> major_mode = Qfundamental_mode; > to: > BUFFER_MAJOR_MODE (b) = Qfundamental_mode; > Doing this transform for all 54 DEFVAR_PER_BUFFER fields is a big pain, > though, so I thought I'd ask about it first. This may have a very significant performance impact. Now, maybe we'll have to bite the bullet sooner or later. But I'd rather not yet. This said, I'd accept a patch that turns all .... b->major_mode ... into .... PER_BUFFER_VAR (b, major_mode) ... or even with two different macros (one for lvalue, and one for rvalue). Stefan