From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Are there plans for a multi-threaded Emacs? Date: Thu, 04 Dec 2003 02:33:47 -0500 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> <87ptf5zn4k.fsf@kanga.tapsellferrier.co.uk> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1070523440 7692 80.91.224.253 (4 Dec 2003 07:37:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 Dec 2003 07:37:20 +0000 (UTC) Cc: tzz@lifelogs.com, nferrier@tapsellferrier.co.uk, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Dec 04 08:37:17 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 1ARo33-0005bo-00 for ; Thu, 04 Dec 2003 08:37:17 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARo32-0003tz-00 for ; Thu, 04 Dec 2003 08:37:17 +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 1ARoyQ-0005Un-Dh for emacs-devel@quimby.gnus.org; Thu, 04 Dec 2003 03:36:34 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ARoy1-0005SS-6t for emacs-devel@gnu.org; Thu, 04 Dec 2003 03:36:09 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ARoxO-00050F-SK for emacs-devel@gnu.org; Thu, 04 Dec 2003 03:36:02 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ARoxK-0004tc-4P for emacs-devel@gnu.org; Thu, 04 Dec 2003 03:35:26 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.24) id 1ARnzf-0007wv-Im; Thu, 04 Dec 2003 02:33:47 -0500 Original-To: Stefan Monnier In-reply-to: (message from Stefan Monnier on 03 Dec 2003 15:29:42 -0500) 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:18354 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18354 Dynamic binding causes no trouble for multiple threads if each thread has its own binding stack and switching threads swaps the bindings. However, code like (setq global-list (cons foo global-list)) is a completely separate issue. The problem here is that thread switching needs to be prevented between the access to global-list and the modification of global-list. Of course, the potential for collision exists because global-list may be referred to elsewhere. But it does not depend on dynamic bindings. If nobody ever binds global-list, if its global binding is the only one, the problem still occurs.