From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Concurrency, again Date: Wed, 12 Oct 2016 18:31:45 -0400 Message-ID: References: <87wq97i78i.fsf@earlgrey.lan> <86k2dk77w6.fsf@molnjunk.nocrew.org> <9D64B8EA-DB52-413D-AE6A-264416C391F3@iotcl.com> <83int1g0s5.fsf@gnu.org> <83twckekqq.fsf@gnu.org> <83mvi9a3mh.fsf@gnu.org> <20161012165911.58437154@jabberwock.cb.piermont.com> <20161012173314.799d1dc5@jabberwock.cb.piermont.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476311558 31233 195.159.176.226 (12 Oct 2016 22:32:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Oct 2016 22:32:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 13 00:32:34 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buS4Q-00063P-T7 for ged-emacs-devel@m.gmane.org; Thu, 13 Oct 2016 00:32:19 +0200 Original-Received: from localhost ([::1]:36206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buS4S-0001oq-NL for ged-emacs-devel@m.gmane.org; Wed, 12 Oct 2016 18:32:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buS4L-0001oF-RK for emacs-devel@gnu.org; Wed, 12 Oct 2016 18:32:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buS4I-0000fS-KH for emacs-devel@gnu.org; Wed, 12 Oct 2016 18:32:13 -0400 Original-Received: from [195.159.176.226] (port=42653 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buS4I-0000dw-Dr for emacs-devel@gnu.org; Wed, 12 Oct 2016 18:32:10 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1buS43-000353-RW for emacs-devel@gnu.org; Thu, 13 Oct 2016 00:31:55 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:8VbfRcBDFGlGC85PBtb/2H4Sw4Q= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208192 Archived-At: >> > One possibility: move to a multiple processes paradigm where each >> > buffer has an associated process, and global variable values are >> > propagated via message passing to a master process. Yes, I also like this paradigm, and it might work for a significant part of existing Elisp code. But that means (with-current-buffer ) is turned into something like (send (lambda () (let ((result )) (send (lambda () ))))) which in turns pretty much implies that (eq (w-c-b buf (point)) (w-c-b buf (point))) might not always be t since some other code might be executed between the two w-c-b. So it breaks some assumptions which current code might (and sometimes does) rely on. To avoid this, we'd have to make it so that with-current-buffer takes a lock on the buffer, but that gets us into the world of deadlocks. > OTOH, I've become fairly convinced over time that what is preferable > are paradigms where there is zero shared low level state between > executing processes. Amen. BTW, in the case of Emacs, something like STM would be great: its potential lackluster performance wouldn't be too much of an issue. The problem is that it fundamentally needs to adorn *all* code that changes shared state (and all code which might have irreversible side-effects), which would require an enormous amount of work. Stefan