From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?B?U8O4cmVuIFBpbGfDpXJk?= Newsgroups: gmane.emacs.devel Subject: Re: Concurrency, again Date: Wed, 12 Oct 2016 23:20:21 +0200 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1476307261 25403 195.159.176.226 (12 Oct 2016 21:21:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Oct 2016 21:21:01 +0000 (UTC) Cc: Eli Zaretskii , Stefan Monnier , emacs-devel@gnu.org To: "Perry E. Metzger" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 12 23:20:56 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 1buQx4-00040v-MH for ged-emacs-devel@m.gmane.org; Wed, 12 Oct 2016 23:20:38 +0200 Original-Received: from localhost ([::1]:35984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buQx3-0000BL-Ao for ged-emacs-devel@m.gmane.org; Wed, 12 Oct 2016 17:20:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buQwt-00009k-Kd for emacs-devel@gnu.org; Wed, 12 Oct 2016 17:20:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buQwr-0001Xx-C2 for emacs-devel@gnu.org; Wed, 12 Oct 2016 17:20:26 -0400 Original-Received: from mail-vk0-x231.google.com ([2607:f8b0:400c:c05::231]:32984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buQwo-0001XK-Lm; Wed, 12 Oct 2016 17:20:22 -0400 Original-Received: by mail-vk0-x231.google.com with SMTP id 83so34735975vkd.0; Wed, 12 Oct 2016 14:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0uWd1mPj2UncyIYW0uezvjLgYwb7tdWmVetCvMaa368=; b=Rvs1xbdaF/FBCKA34BGvJsCSPZc2+ijke7db5PsL9AXCXw9znR+R2Xdm9Pycf+bM8G mnpfZ5Z6lvAERo6HPO1NjukZCg3BEr9pJV16V8zvjF3OBUt05vo+H9bQ8e5zVSF02RJi 8uUs1DgoX1ADukDF/9CCU+igQ/39Wcd3IkqizaCptJXSsHB4++gPCwiHnGVoPvIEoDMa iiMboQeFSRmlUppLQGzRVyLlDvzi5Y1KqNk3xnpSxRH4pxIDphRNs54tM7vPFDby8Ro4 ceXzXTAf3UgxiFyUYmHqyqay5ipQaCCUCRnyp7UkWiCfxb71EWhawht8y0SpCAt3QPce rvcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0uWd1mPj2UncyIYW0uezvjLgYwb7tdWmVetCvMaa368=; b=ZbQXQtd+m4q/BdpZHKLW+3lC35hvRy0+O+WdRUp4nqWGOCqgKRM5VVRKw88tSvS8MZ TZHGI5WRPSWWFW0+dtyBRAEnX8L+IEaPEKuMYzvsy99BerKgFwLYTELgNT3wbnTbsebp nKdG+ukBUMFrmdR5/Z3nH75UyHXufP1uS0t4pLhTAIW9f9Mpxj8XFECgKbhBSo+g5lNJ EVhPWTq2sZkvqEvZpKm44ok9NyVlp9qlQcvBDVGozFhYtSRqczWaMyjElJ10XO6tGp55 Ncu0cmJp/8Xxpcg/q6CXPLXmfNPEcN6NlDjwc+OVPLimjjQ/w3/t5xM5aSWQcN8sfja/ TYLw== X-Gm-Message-State: AA6/9Rkxpe954gPzGjz3UqRkmhYAQgvBEdHGL08zZIius9vHAX225l7yq1xk+g5WrJ03/yhIIWM3hCa0WpsPdw== X-Received: by 10.31.181.142 with SMTP id e136mr1724769vkf.45.1476307222121; Wed, 12 Oct 2016 14:20:22 -0700 (PDT) Original-Received: by 10.103.48.141 with HTTP; Wed, 12 Oct 2016 14:20:21 -0700 (PDT) In-Reply-To: <20161012165911.58437154@jabberwock.cb.piermont.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c05::231 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:208189 Archived-At: On Wed, Oct 12, 2016 at 10:59 PM, Perry E. Metzger wrote: > On Wed, 12 Oct 2016 15:43:12 -0400 Stefan Monnier > wrote: >> - I want semantic-mode to scan my buffers in the background and to >> scan several buffers at the same time, to make use of my 8 cores. >> The concurrency branch doesn't really try to solve this problem. >> I'm not sure what's the best way to solve this problem, and I >> don't even know what would be a "simple" way to solve this problem. > > 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. Think Hoare's CSP > or Go or Erlang for precedents, though perhaps with more sugaring to > make it easy for Emacs users to not think much about global state. > > This sort of model might be especially important if Emacs starts > being used as a serious web browser by lots of its community, given > how much CPU modern browsers can eat. > The thing is all current code expects to be able to access any buffer they like without interferrence from other code. So to make this new model work we would need to support both paradigms. If any "old-style" code started execution, by being called by a function or from a timer, then the entire world would have to halt so the old-style code could execute with its assumption of sequential access. And then each "new-style" code currently executing would have to "finish" its execution and somehow mark that now its buffer and bufferlocal variables are in a safe state for the old-style code to execute. When all current new-style code is marked "safe" then the old-style code can execute and when done emacs can continue execution of all the new-style code. Does this make sense?