emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Concurrency, again


From: Søren Pilgård
Subject: Re: Concurrency, again
Date: Wed, 12 Oct 2016 23:20:21 +0200

On Wed, Oct 12, 2016 at 10:59 PM, Perry E. Metzger <address@hidden> wrote:
> On Wed, 12 Oct 2016 15:43:12 -0400 Stefan Monnier
> <address@hidden> 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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]