From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: Re: Concurrency, again Date: Wed, 12 Oct 2016 16:33:16 -0700 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 1476315231 14628 195.159.176.226 (12 Oct 2016 23:33:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Oct 2016 23:33:51 +0000 (UTC) User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (darwin) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 13 01:33:47 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 1buT1i-0001mo-Qf for ged-emacs-devel@m.gmane.org; Thu, 13 Oct 2016 01:33:34 +0200 Original-Received: from localhost ([::1]:36416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buT1i-0000oQ-Ez for ged-emacs-devel@m.gmane.org; Wed, 12 Oct 2016 19:33:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buT1a-0000mk-2F for emacs-devel@gnu.org; Wed, 12 Oct 2016 19:33:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buT1V-00072v-UC for emacs-devel@gnu.org; Wed, 12 Oct 2016 19:33:25 -0400 Original-Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]:36005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buT1V-00072T-Nk for emacs-devel@gnu.org; Wed, 12 Oct 2016 19:33:21 -0400 Original-Received: by mail-pa0-x235.google.com with SMTP id ry6so32605224pac.3 for ; Wed, 12 Oct 2016 16:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mail-followup-to:mime-version; bh=pYnd34AvqgiMkOEu+vga1lnUiBsxYraM9lZ+d6GuarM=; b=pOL0SuKfPQw9GL873dSZfmn/5Ukg5C0vh29s3xIVNQiRBL0MMcd9oY7bcbjpTE0OdH S07oVSuallNjqXdj21rl0fwPqzq2wZFE9rP4DNq88k5Znwj6eDxhW91AgBZk4IqToRJz CUMRqKGy3rIx8TUQNWYE/dgZJ2ZaagTlGOMIglRSTZi7haaYqybDxLmVbapsK95MlkgH 5oXX0NsYZ39s1NDCyXlHJSOusyYh5kjGCbZ9olipJe5K52XpfQMzxAwOh4vXKKjAsux1 6sxq2/MZI4ov730/nsemDSIp1ffgOBQ8NILXRfgpwXl+gtRP4R8d6X4MzdespWxHi+5U mKZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mail-followup-to:mime-version; bh=pYnd34AvqgiMkOEu+vga1lnUiBsxYraM9lZ+d6GuarM=; b=BZcYS27UL/eauS6cpt8TG2NuTPhYk5ohWdjNvoftEhpRIkZ8K6ZR6dQPlIchr0Spzw 1vruUaeri7P8ffy9CQv74RqF0qSFg5KYShWOUcd2JnwFSEHqNnnOCmIYFhzMHs+KulZw 3Ok+DWIY+TWmygZGhL4gv0vi9biTTFH00MVL4PqD6kvb5F5lf6cwh76+YvYMMmYclyW6 1EEEZfLPluuWRhF9hag9ydON7W9bBtWJnOBAOPN1H2IUeGAnXnkjCASjZQ8JbdE6i1xc MB53p4E0jbxHTGH/zBbxBjNbz4tuJvCIWiaSQhRE9HVEwVpFryba7+ro5fRip/19nCnA TYRw== X-Gm-Message-State: AA6/9RmJM92yGc1nH2nyU4Y/RLFd5liuTnBxPiCUSdw1xIxchIbkC9BfbqY6j+mqxu9maQ== X-Received: by 10.66.190.4 with SMTP id gm4mr4661988pac.210.1476315200909; Wed, 12 Oct 2016 16:33:20 -0700 (PDT) Original-Received: from Vulcan.local (76-234-69-149.lightspeed.frokca.sbcglobal.net. [76.234.69.149]) by smtp.gmail.com with ESMTPSA id c15sm14286637pfd.53.2016.10.12.16.33.19 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 12 Oct 2016 16:33:20 -0700 (PDT) X-Google-Original-From: "John Wiegley" Original-Received: by Vulcan.local (Postfix, from userid 501) id 891472E85AD5; Wed, 12 Oct 2016 16:33:19 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 12 Oct 2016 18:31:45 -0400") Mail-Followup-To: Stefan Monnier , emacs-devel@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::235 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:208194 Archived-At: >>>>> "SM" == Stefan Monnier writes: >>> > 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. SM> Yes, I also like this paradigm, and it might work for a significant part SM> of existing Elisp code. You can try out the paradigm today with async.el, since that's exactly what it does. SM> BTW, in the case of Emacs, something like STM would be great: its SM> potential lackluster performance wouldn't be too much of an issue. The SM> problem is that it fundamentally needs to adorn *all* code that changes SM> shared state (and all code which might have irreversible side-effects), SM> which would require an enormous amount of work. If we distinguish between pure and impure forms in the evaluator, we could enforce that STM transactions are only allowed using pure forms, plus interactions with transactional variables. This is all that Haskell lets you to do, but it's quite enough for effective inter-thread communication. However, if the concurrency we allow is cooperative, all we need to do is disallow yielding within blocks marked as atomic. -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2