From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nic Newsgroups: gmane.emacs.devel Subject: buffer transactions (was Re: Very interesting analysis of "the state of Emacs") Date: Mon, 05 May 2008 00:23:46 +0100 Message-ID: <871w4htzzx.fsf_-_@nic.woome.com> References: <481693C3.70901@emf.net> <4816CDB6.6000006@pajato.com> <4817D79F.8040508@gmail.com> <874p9jhsa7.fsf@localhorst.mine.nu> <87bq3qodp4.fsf@bar.jrock.us> <87od7qikyc.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1209943789 2067 80.91.229.12 (4 May 2008 23:29:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 May 2008 23:29:49 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 05 01:30:25 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jsnex-0008BF-Tx for ged-emacs-devel@m.gmane.org; Mon, 05 May 2008 01:30:24 +0200 Original-Received: from localhost ([127.0.0.1]:48153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JsneG-0005Ak-47 for ged-emacs-devel@m.gmane.org; Sun, 04 May 2008 19:29:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JsneB-0005AP-Ny for emacs-devel@gnu.org; Sun, 04 May 2008 19:29:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jsne9-0005A7-1J for emacs-devel@gnu.org; Sun, 04 May 2008 19:29:34 -0400 Original-Received: from [199.232.76.173] (port=54867 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jsne8-0005A4-Sn for emacs-devel@gnu.org; Sun, 04 May 2008 19:29:32 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jsne8-0000dJ-RK for emacs-devel@gnu.org; Sun, 04 May 2008 19:29:32 -0400 Original-Received: from owls-tree.tapsellferrier.co.uk ([81.187.188.218] helo=owls-house.tapsellferrier.co.uk) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jsne8-00029T-0A for emacs-devel@gnu.org; Sun, 04 May 2008 19:29:32 -0400 Original-Received: from nicferrier.tapsellferrier.co.uk ([172.31.50.1] helo=nicferrier.localdomain) by owls-house.tapsellferrier.co.uk with esmtp (Exim 4.69 #1 (Debian)) id 1JsnUX-0005yc-5a; Mon, 05 May 2008 00:19:37 +0100 Original-Received: by nicferrier.localdomain (Postfix, from userid 1000) id 4776C3FD1; Mon, 5 May 2008 00:23:46 +0100 (BST) In-Reply-To: (Richard M. Stallman's message of "Sun\, 04 May 2008 05\:37\:53 -0400") X-detected-kernel: by mx20.gnu.org: Genre and OS details not recognized. X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:96461 Archived-At: Richard M Stallman writes: > Good point. But I don't think it's a problem either: what I meant by > "multithreading within a single buffer" is that we'd have a lock per > buffer. Whenever lisp code enters a buffer, we'd acquire the lock. > > What does it mean to "enter a buffer"? Does calling `set-buffer' do > that? > > If it means entering the code of a primitive that directly examines or > alters the buffer contents, I would suggest not allowing a thread > switch inside of them (or most primitives). If the threads are > implemented explicitly in our C code, switching can happen only where > we want it to happen. That would avoid lots of problems. We would > only allow thread switches at places where Lisp code can be run. Just an idle thought... has anyone considered transactional support for buffer modification in emacs? This would enable simultaneous access to buffers by different processes/threads and (it seems) could be implemented by changing the insert primitives in scope for a background process to record a transaction log of all the changes a it wants to make to a buffer (or variable for that matter) and merging it with the state of the actual buffer on completion of the process. -- Nic Ferrier http://www.woome.com - Enjoy the minute!