From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Are there plans for a multi-threaded Emacs? Date: 04 Dec 2003 17:17:43 +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 1070555198 7690 80.91.224.253 (4 Dec 2003 16:26:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 Dec 2003 16:26:38 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Dec 04 17:26:31 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 1ARwJD-0003Js-00 for ; Thu, 04 Dec 2003 17:26:31 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARwJC-0001c1-00 for ; Thu, 04 Dec 2003 17:26:31 +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 1ARwQI-00015l-GF for emacs-devel@quimby.gnus.org; Thu, 04 Dec 2003 11:33:50 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ARwIJ-0006l3-9M for emacs-devel@gnu.org; Thu, 04 Dec 2003 11:25:35 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ARwCo-0004yx-B6 for emacs-devel@gnu.org; Thu, 04 Dec 2003 11:20:25 -0500 Original-Received: from [212.88.64.25] (helo=mail-relay.sonofon.dk) by monty-python.gnu.org with smtp (Exim 4.24) id 1ARwCm-0004w4-MT for emacs-devel@gnu.org; Thu, 04 Dec 2003 11:19:52 -0500 Original-Received: (qmail 69457 invoked from network); 4 Dec 2003 15:18:22 -0000 Original-Received: from unknown (HELO kfs-l.imdomain.dk.cua.dk) (213.83.150.2) by 0 with SMTP; 4 Dec 2003 15:18:22 -0000 Original-To: emacs-devel@gnu.org In-Reply-To: Original-Lines: 66 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:18379 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18379 David Kastrup writes: > Ted Zlatanov writes: > > > 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. I don't really agree that this is worthwhile. IMO, there are many other improvements that are more important than multi-threading. Of course, if we had unlimited development _and_ _testing_ resources, it would be a nice thing to add, but I don't like the idea of adding something _really complex_ like that which may potentially de-stabilize emacs for a long time. Even if you add multi-threading to Elisp, the applications need to be made aware of that. How much -additional- work would be it be to rework, say, GNUS to be multi-threaded? Actually, a lot of code could already be improved today with better use of process filters and sentinels, but that hasn't been done. So even if we had multi-threading, I doubt that it would be widely used. > So changing Emacs' scopes to lexical is a prerequisite for any > meaningful attempt at multithreading, anyway. The lexical binding could be on a per-project or per-file basis, rather than an over-all change to Elisp. That would allow projects which requires multi-threading to use lexical scoping. _IF_ they use dynamic scoping, it will result in unexplicable errors, but the byte-compiler might warn against such uses, so we don't need run-time checking. IIRC the plans to add lexical scoping to Elisp is per-file, and rumours is that there already exist patches to achieve this. > > 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. I still wonder why people want multi-threading in Elisp -- IMHO, emacs works just fine without it! I admit (synchronous) GNUS is a problem, but except for that, I don't really see that much code which will benefit vastly from being executed by a multi-threaded emacs. And for GNUS, you can just run two instances of emacs on your multi-tasking OS. Likewise, if you have some vast app writting in Elisp, just start a second emacs to run it. Problem solved! -- Kim F. Storm http://www.cua.dk