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:55 -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 1070523438 7689 80.91.224.253 (4 Dec 2003 07:37:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 Dec 2003 07:37:18 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Dec 04 08:37:15 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 1ARo31-0005bf-00 for ; Thu, 04 Dec 2003 08:37:15 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARo31-0003tz-00 for ; Thu, 04 Dec 2003 08:37:15 +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 1ARoz9-0005tR-No for emacs-devel@quimby.gnus.org; Thu, 04 Dec 2003 03:37:19 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ARoy1-0005So-Jv 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 1ARoxR-00052X-Oa for emacs-devel@gnu.org; Thu, 04 Dec 2003 03:36:04 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ARoxR-00052M-GM for emacs-devel@gnu.org; Thu, 04 Dec 2003 03:35:33 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.24) id 1ARnzn-0007yF-Eu; Thu, 04 Dec 2003 02:33:55 -0500 Original-To: bob@rattlesnake.com In-reply-to: (bob@rattlesnake.com) 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:18353 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18353 But maybe if we add one lock per buffer and we make `with-current-buffer' acquire&release the lock we might get a workable model, albeit with a necessarily very coarse grain .... A lock on with-current-buffer can't really solve the problem, because only a few of the functions that modify a buffer use with-current-buffer. However, perhaps you're thinking of allowing a few specially-designated asynchronous threads, each of which would edit only its own buffer or buffers so that they won't get in each others' way, that might work if the code that runs in these specially-designated threads is specially written to be safe in such a thread. That might be a workable idea. In other words, there would be one thread that has full capability to run anything, including old unmodified code, and any number of other threads that run only specially-designed thread-safe code. This approach MIGHT be workable. The devil is in the details, so someone would probably have to study them.