From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Benjamin Riefenstahl Newsgroups: gmane.emacs.devel Subject: Re: Are there plans for a multi-threaded Emacs? Date: Sun, 30 Nov 2003 19:12:00 +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> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1070216235 28198 80.91.224.253 (30 Nov 2003 18:17:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Nov 2003 18:17:15 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Nov 30 19:17: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 1AQW89-00070L-00 for ; Sun, 30 Nov 2003 19:17:13 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AQW88-0005WM-00 for ; Sun, 30 Nov 2003 19:17: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 1AQX4c-0001nz-F1 for emacs-devel@quimby.gnus.org; Sun, 30 Nov 2003 14:17:38 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AQX3U-0000wC-6J for emacs-devel@gnu.org; Sun, 30 Nov 2003 14:16:28 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AQX2R-0007eg-OQ for emacs-devel@gnu.org; Sun, 30 Nov 2003 14:15:54 -0500 Original-Received: from [193.28.100.166] (helo=mail.epost.de) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AQX26-0007IS-7Q for emacs-devel@gnu.org; Sun, 30 Nov 2003 14:15:02 -0500 Original-Received: from seneca.benny.turtle-trading.net.epost.de (193.99.153.30) by mail.epost.de (6.7.019) id 3FA8306E0034FD34; Sun, 30 Nov 2003 19:13:35 +0100 Original-To: Kai Grossjohann In-Reply-To: <87ekvpx18d.fsf@emptyhost.emptydomain.de> (Kai Grossjohann's message of "Sun, 30 Nov 2003 16:36:18 +0000") User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3.50 (gnu/linux) 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:18223 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18223 Hi Kai, Kai Grossjohann writes: > Well, I don't know a lot about threading, but Java, at least, has > the same problem: you need to synchronize access to a variable to > prevent such things from happening. By default, synchronized access > is turned off. > > [...] > > What do people think? Maybe I missed something obvious... Just a thought: The Asm/C/Java model of threads is not the only possibility. Another model is to create isolated contexts/interpreters for each thread and require explicit coding to communicate between the threads and for setting up variables that are synchronized between them. This is easier to use in a migration from a single-thread model, and I think it is also easier and safer to program in general. OTOH, with a system that does so much in LISP as Emacs does, even going to the trouble of dump and undump, this model can lead to a lot of duplicated state, which of course costs memory and also may create inconsistencies at the user level, when customizations only apply to one thread but not to the other. As I said, just a thought... benny