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: Tue, 02 Dec 2003 12:44:10 -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: <4nn0abi07p.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> <33AB7A8C-24D6-11D8-9D12-000A95D9C74C@fugue.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1070390356 16361 80.91.224.253 (2 Dec 2003 18:39:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 2 Dec 2003 18:39:16 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Dec 02 19:39:13 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 1ARFQW-0006Oz-00 for ; Tue, 02 Dec 2003 19:39:12 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARFQW-00017x-00 for ; Tue, 02 Dec 2003 19:39:12 +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 1ARGNW-0004M1-FG for emacs-devel@quimby.gnus.org; Tue, 02 Dec 2003 14:40:10 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ARFja-0002zb-1e for emacs-devel@gnu.org; Tue, 02 Dec 2003 13:58:54 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ARFj1-0002k3-QP for emacs-devel@gnu.org; Tue, 02 Dec 2003 13:58:51 -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 1ARFfu-00011a-5f for emacs-devel@gnu.org; Tue, 02 Dec 2003 13:55:06 -0500 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by mx20.gnu.org with esmtp (Exim 4.24) id 1AREb0-00011o-Cd for emacs-devel@gnu.org; Tue, 02 Dec 2003 12:45:58 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AREaz-0000rp-00 for ; Tue, 02 Dec 2003 18:45:57 +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 1AREay-0000rh-00 for ; Tue, 02 Dec 2003 18:45:56 +0100 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AREay-0002Td-00 for ; Tue, 02 Dec 2003 18:45:56 +0100 Original-Lines: 33 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:MctLG1vlr0OnPNf/PBJS7fXCYj4= 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:18291 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18291 On Tue, 2 Dec 2003, mellon@fugue.com wrote: On Dec 1, 2003, at 10:04 AM, Ted Zlatanov wrote: >> I think migrating Emacs towards a threading model is possible: > > Maybe this is a stupid question, but what's the payoff you're > expecting when you're done with this project? What is it about > Emacs that makes it worth a major rewrite in order to make it > multithreaded? I realize that multithreading will introduce small > conveniences in some cases, but in general writing multithreaded > code is a total pain in the neck, so my guess is that the cost of > those small conveniences would be more than they'd be worth, and you > might be able to get them cheaper using some other technique, if you > could identify what they are. Per already mentioned Gnus. Generally any place in Emacs where you could be doing task A while task B is waiting for a blocking resource. Also, an event-driven model for user interaction would be easier to implement in a way that's functional for the user. In a way, this is a very valid question - what can't be done with processes that threads can do? You can do almost everything without threads, but the cost is very high in terms of portability, resource usage, and ease of use. Furthermore, as I mentioned, processes are much harder to couple (for data sharing) than threads. Ideally, you won't have to worry about multithreading if you don't want to. Java allows programmers to mark functions as synchronous, so only one of it can be running at once. I proposed doing this by default for all Emacs functions, and then making them thread-safe step by step. Ted