From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Are there plans for a multi-threaded Emacs? Date: 04 Dec 2003 15:07:07 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87oevbes4h.fsf@emacswiki.org> <20031117040607.C6C5D79B72@server2.messagingengine.com> <87ekvpx18d.fsf@emptyhost.emptydomain.de> <4nad6cikxy.fsf@holmes.bwh.harvard.edu> <4nllpt3hr3.fsf@lockgroove.bwh.harvard.edu> <5bad69zd43.fsf@lister.roxen.com> <4noeuon378.fsf@lockgroove.bwh.harvard.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1070547701 21521 80.91.224.253 (4 Dec 2003 14:21:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 Dec 2003 14:21:41 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Dec 04 15:21:36 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARuMJ-0000y4-00 for ; Thu, 04 Dec 2003 15:21:35 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARuMJ-0008WH-00 for ; Thu, 04 Dec 2003 15:21:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ARvJc-0002ET-TW for emacs-devel@quimby.gnus.org; Thu, 04 Dec 2003 10:22:52 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ARvJR-0002DO-8K for emacs-devel@gnu.org; Thu, 04 Dec 2003 10:22:41 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ARvBk-0000JO-P8 for emacs-devel@gnu.org; Thu, 04 Dec 2003 10:15:16 -0500 Original-Received: from [62.226.11.218] (helo=localhost.localdomain) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1ARv5t-0007FZ-9u for emacs-devel@gnu.org; Thu, 04 Dec 2003 10:08:41 -0500 Original-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id hB4E78Na006716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Dec 2003 15:07:08 +0100 Original-Received: (from dak@localhost) by localhost.localdomain (8.12.8/8.12.8/Submit) id hB4E783n006712; Thu, 4 Dec 2003 15:07:08 +0100 Original-To: Ted Zlatanov In-Reply-To: <4noeuon378.fsf@lockgroove.bwh.harvard.edu> Original-Lines: 41 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18367 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18367 Ted Zlatanov writes: > > I see these benefits with this model compared to a "fully" > > multithreaded variant: > > > > o Fairly small changes in the C code. > > > o No significant change in the elisp execution model, at least not > > if preemption is avoided. > > > o Little overhead in locking - there's no fine grained locking on > > individual data structures. > > I agree with all those. Converting a single-threaded application to > multithreaded, especially one as complex as Emacs, is a daunting > task. I think it's worthwhile. Not everything that is worthwhile gets done. In order to even have a minuscule chance of having reasonably parallel executable code, we need to have lexical instead of dynamic scope. Parallizing code that is depending on changes of a global namespace for every involved local variable is near to impossible. So changing Emacs' scopes to lexical is a prerequisite for any meaningful attempt at multithreading, anyway. If we can't find the resources and volunteers for doing this step, we will certainly not get beyond to the even more ambitious task of multithreading for which it is an absolutely indispensible prerequisite in my opinion. Apart from giving people perhaps more enthusiasm for working on the lexical binding problem, I don't see what actually workable perspectives the multithreading buys us. Even then, it would be unfair to suggest people that if their desire is to get multithreading, that finishing some lexical binding project will make their goal come into easy reach. It is a prerequisite in my opinion, but quite far from making the ultimate goal easy to achieve. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum