From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Patch for fields of `struct buffer' Date: Mon, 31 Jan 2011 14:37:27 -0500 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: dough.gmane.org 1296502667 1742 80.91.229.12 (31 Jan 2011 19:37:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 31 Jan 2011 19:37:47 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 31 20:37:40 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 1PjzZE-00080J-CN for ged-emacs-devel@m.gmane.org; Mon, 31 Jan 2011 20:37:40 +0100 Original-Received: from localhost ([127.0.0.1]:48122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjzZD-0007Db-Uy for ged-emacs-devel@m.gmane.org; Mon, 31 Jan 2011 14:37:39 -0500 Original-Received: from [140.186.70.92] (port=55938 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjzZ9-0007DM-41 for emacs-devel@gnu.org; Mon, 31 Jan 2011 14:37:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjzZ8-0006bP-60 for emacs-devel@gnu.org; Mon, 31 Jan 2011 14:37:34 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:38983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjzZ8-0006bJ-3I for emacs-devel@gnu.org; Mon, 31 Jan 2011 14:37:34 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1PjzZ1-0004Dz-Lv; Mon, 31 Jan 2011 14:37:27 -0500 In-reply-to: (message from Tom Tromey on Sun, 30 Jan 2011 13:23:53 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 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:135334 Archived-At: Yes. I think that is the right tradeoff given my long term goal, which is preemptive multi-threading. I don't think preemptive thread switching is a sensible goal. It is so much trouble that it isn't worth doing even in the long term. Thus, it is a mistake to do much work now, or complicate the code now, or cause a slowdown now, for the sake of preemptive thread switching. Also, the cost from this patch (and its successor) only applies to DEFVAR_PER_BUFFER and DEFVAR_KBOARD variables. That is more limited than I thought it was. If it is needed for non-preemptive thread switching, the benefit would justify the cost, but I think it isn't needed for that. If this is would only be needed for preemptive thread switching, I think the loss of clarity and naturalness of the code is enough reason not to do it. Meanwhile, I am concerned about this: * DEFVAR_LISP and other true globals. These will be handled efficiently by using pointer tricks. Each global will have a corresponding pointer to it, and each thread will have its own copy of all of these. That is incorrect semantics. Most ofthese values should be shared between all the threads that don't bind them somehow, just as they are shared between all the buffers that don't bind them. * Ordinary Lisp variables, not defined by C code. These will always involve an indirection through find_variable_location. However, ordinary Lisp variable access may already involve various indirections due to Lisp_Buffer_Local_Value, Lisp_Buffer_Objfwd, etc. Are you saying you would like to change it so that every access to a Lisp variable requires indirecting? At present, every access to a Lisp variable requires a test for possible indirections, but most variables don't have an indirection. -- Richard Stallman President, Free Software Foundation 51 Franklin St Boston MA 02110 USA www.fsf.org, www.gnu.org