From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: Patch for fields of `struct buffer' Date: Mon, 31 Jan 2011 12:57:52 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1296504129 10207 80.91.229.12 (31 Jan 2011 20:02:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 31 Jan 2011 20:02:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 31 21:02:05 2011 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.69) (envelope-from ) id 1Pjzwq-0004Fx-CD for ged-emacs-devel@m.gmane.org; Mon, 31 Jan 2011 21:02:04 +0100 Original-Received: from localhost ([127.0.0.1]:36124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pjzwp-0000ie-II for ged-emacs-devel@m.gmane.org; Mon, 31 Jan 2011 15:02:03 -0500 Original-Received: from [140.186.70.92] (port=32910 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pjzt8-0006dS-P7 for emacs-devel@gnu.org; Mon, 31 Jan 2011 14:58:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pjzt0-0000js-Og for emacs-devel@gnu.org; Mon, 31 Jan 2011 14:58:14 -0500 Original-Received: from mx1.redhat.com ([209.132.183.28]:38411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pjzsp-0000eD-Fy; Mon, 31 Jan 2011 14:57:55 -0500 Original-Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0VJvsjF005557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 31 Jan 2011 14:57:54 -0500 Original-Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p0VJvsu2016176; Mon, 31 Jan 2011 14:57:54 -0500 Original-Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p0VJvrL1026769; Mon, 31 Jan 2011 14:57:53 -0500 Original-Received: by opsy.redhat.com (Postfix, from userid 500) id 109F63782CA; Mon, 31 Jan 2011 12:57:52 -0700 (MST) X-Attribution: Tom In-Reply-To: (Richard Stallman's message of "Mon, 31 Jan 2011 14:37:27 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 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:135340 Archived-At: RMS> I don't think preemptive thread switching is a sensible goal. It RMS> is so much trouble that it isn't worth doing even in the long term. I don't think it is nearly that bad. RMS> That is more limited than I thought it was. If it is needed for RMS> non-preemptive thread switching, the benefit would justify the cost, RMS> but I think it isn't needed for that. If this is would only be needed RMS> for preemptive thread switching, I think the loss of clarity and RMS> naturalness of the code is enough reason not to do it. Ok. I will stop work on this patch, then. I am not sure if I am interested in working on threads done the other way, I will have to think about it. You might want to consider backing out my earlier patch. It won't be needed either. Tom> * DEFVAR_LISP and other true globals. Tom> These will be handled efficiently by using pointer tricks. Each Tom> global will have a corresponding pointer to it, and each thread will Tom> have its own copy of all of these. RMS> That is incorrect semantics. Most ofthese values should be shared RMS> between all the threads that don't bind them somehow, just as they RMS> are shared between all the buffers that don't bind them. I wasn't clear enough. For each global variable, the per-thread pointer will ordinarily point to the main thread's slot. When the variable is let-bound, thus becoming thread-local, the pointer will be redirected to the slot in the per-thread structure. When the outermost let-binding is undone, the pointer will be reset to the main thread's slot. I think this implements the correct semantics: a global variable's value is shared between all threads, and a let-bound variable is thread-local. RMS> Are you saying you would like to change it so that every access to RMS> a Lisp variable requires indirecting? Only potentially -- like today. RMS> At present, every access to a Lisp variable requires a test for RMS> possible indirections, but most variables don't have an indirection. That will continue to be the case. We can add another value to enum symbol_redirect to indicate variables which are potentially thread-local. Tom