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: Mon, 01 Dec 2003 11:04:09 -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: <4nad6cikxy.fsf@holmes.bwh.harvard.edu> References: <87oevbes4h.fsf@emacswiki.org> <20031117040607.C6C5D79B72@server2.messagingengine.com> <87ekvpx18d.fsf@emptyhost.emptydomain.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1070344177 26648 80.91.224.253 (2 Dec 2003 05:49:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 2 Dec 2003 05:49:37 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Dec 02 06:49:35 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 1AR3Pj-0005RC-00 for ; Tue, 02 Dec 2003 06:49: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 1AR3Pd-0006yu-00 for ; Tue, 02 Dec 2003 06:49:29 +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 1AR4Ka-0006qm-AY for emacs-devel@quimby.gnus.org; Tue, 02 Dec 2003 01:48:20 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AR1wr-0000YU-Ub for emacs-devel@gnu.org; Mon, 01 Dec 2003 23:15:41 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AQxvG-0007JJ-Ih for emacs-devel@gnu.org; Mon, 01 Dec 2003 18:58:17 -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 1AQrZQ-0004Kd-Ex for emacs-devel@gnu.org; Mon, 01 Dec 2003 12:10:48 -0500 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by mx20.gnu.org with esmtp (Exim 4.24) id 1AQqY5-0007zR-3j for emacs-devel@gnu.org; Mon, 01 Dec 2003 11:05:21 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AQqXs-0001z9-00 for ; Mon, 01 Dec 2003 17:05:08 +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 1AQqXq-0001z1-00 for ; Mon, 01 Dec 2003 17:05:06 +0100 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AQqXq-0003dC-00 for ; Mon, 01 Dec 2003 17:05:06 +0100 Original-Lines: 30 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:9D2RsCkJX8+z7G8O343j/dAVZ8E= 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:18259 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18259 On Sun, 30 Nov 2003, kai@emptydomain.de wrote: > Then the remaining problem is that possibly a lot of functions > cannot be safely used because they access global variables. But > that is just something that people will have to live with, and maybe > it will get better over time. I think that it will be good enough > at least for some packages to do part of their work in the > background. I think migrating Emacs towards a threading model is possible: - start with all primitive or ELisp functions assumed NOT thread-safe - allow threads to run, but any access to a function needs to be synchronous. At first, this will effectively make threads simple switched tasks, and will probably make Emacs slower. - gradually migrate functions, starting with the primitives, towards whatever threading model Emacs assumes. Use some kind of function attribute to mark thread-safe behavior. With time, threads will become efficient and fast. The internal implementation of threads will be the difficult part. It took Perl a LONG time to get working threads internally. I think heavyweight threads (multiple processes) is not a good choice for Emacs, because of the heavy interaction and data passing between the internal functions. Ted