From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: Are there plans for a multi-threaded Emacs? Date: Thu, 04 Dec 2003 14:55:13 -0500 Organization: =?koi8-r?q?=F4=C5=CF=C4=CF=D2=20=FA=CC=C1=D4=C1=CE=CF=D7?= @ Cienfuegos Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <4ny8tsgxy6.fsf@lockgroove.bwh.harvard.edu> 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 1070569027 6616 80.91.224.253 (4 Dec 2003 20:17:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 Dec 2003 20:17:07 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Dec 04 21:16:59 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 1ARzuF-0004Mr-00 for ; Thu, 04 Dec 2003 21:16:59 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARzuF-0004OM-00 for ; Thu, 04 Dec 2003 21:16:59 +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 1AS0l5-00007C-D4 for emacs-devel@quimby.gnus.org; Thu, 04 Dec 2003 16:11:35 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AS0jx-0008Aj-Sg for emacs-devel@gnu.org; Thu, 04 Dec 2003 16:10:25 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AS0jP-00081c-CT for emacs-devel@gnu.org; Thu, 04 Dec 2003 16:10:23 -0500 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AS0eV-0006VX-83 for emacs-devel@gnu.org; Thu, 04 Dec 2003 16:04:47 -0500 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by mx20.gnu.org with esmtp (Exim 4.24) id 1ARzaY-00020g-FF for emacs-devel@gnu.org; Thu, 04 Dec 2003 14:56:38 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1ARzaW-0003OU-00 for ; Thu, 04 Dec 2003 20:56:36 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARzaU-0003OM-00 for ; Thu, 04 Dec 2003 20:56:34 +0100 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1ARzaU-00011s-00 for ; Thu, 04 Dec 2003 20:56:34 +0100 Original-Lines: 82 Original-X-Complaints-To: usenet@sea.gmane.org X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (usg-unix-v) Cancel-Lock: sha1:VzAeLbiiBDWkaRZptd1CqJwfO10= 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:18395 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18395 On 04 Dec 2003, storm@cua.dk wrote: > David Kastrup writes: > >> Ted Zlatanov writes: >> > 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. I meant it's worthwhile to add multithreading to Emacs, not that it should override other, more important tasks for the Emacs developers. I'm sorry if I gave the wrong impression. > 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? Specifically with Gnus the work would be pretty extensive. Gnus relies on a lot of buffer-local and global variables. I'd personally commit quite a few hours to that project because it will be fun. > 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. I don't think process filters would help much if I wanted to look up several entries in a hashtable in parallel to build an article summary buffer. Right now, doing this sequentially is the only way, and consequently doing fancy things while building the summary buffer is not a good idea. What I mean is, say we have N articles in a mail-group (in Gnus, seen in the summary buffer). For each article, I want to look up certain things in a hashtable. I am sure that the lookups will not involve any variable modifications. I'd rather start N or (fraction of N) threads than do N sequential lookups. This is just an example for Gnus, because I'm most familiar with that application. I'm sure that other applications, for instance anything that does parallel independent calculations, will benefit from multithreading as opposed to process filters or sentinels. > I still wonder why people want multi-threading in Elisp -- IMHO, > emacs works just fine without it! For example, gnuclient could be used to get immediate results instead of waiting for the current task to complete. That would be useful. > 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. I don't think vast improvements can be expected, either. It will improve the user experience, though. > 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! Come on, that's giving up on the problem. I already run two copies of Emacs, one for editing and one for Gnus. There's problems with that. For instance, files I open in the one that quits first don't get in the .session file because the second one overwrites the .session file. Ted