all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Richard Stallman <rms@gnu.org>,
	emacs-devel@gnu.org, p.stephani2@gmail.com, yyoncho@gmail.com,
	alexanderm@web.de, eliz@gnu.org,
	Drew Adams <drew.adams@oracle.com>
Subject: Re: Questions about throw-on-input
Date: Fri, 15 May 2020 10:19:35 +0200	[thread overview]
Message-ID: <VI1PR06MB45260AF5587C677D09D0C7E796BD0@VI1PR06MB4526.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <jwvwo5dlv33.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 14 May 2020 23:54:09 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> An editor buffer is global mutable state.  Global mutable state is at
>> the heart of GNU Emacs, and I disagree with the idea that we should
>> try to get away from it.  That is a non-goal.
>
> But the goal talked about here is concurrency.  Concurrency is not
> incompatible with global state, but it's incompatible with global state
> accessed from anywhere without any way to control it.
>
> The problem, as I see it, is that we could imagine binding threads to
> buffers such that a buffer can only be accessed by a single thread at
> a time.
>
> That would be reasonably easy to implement, I think, by putting a lock
> on buffer objects (since there are fairly few ways to access a buffer:
> you almost always have to make it current first).  But the buffer's
> local variables can contain data such as hash-tables or cons-cells which
> can be shared between various buffers, and that is a lot harder to
> control because we don't want to put a lock on every cons cell.
>
> Maybe we could have a notion of "buffer-local data/heap" and "global
> read-only data/heap" or something like that and some way make sure that
> a thread only operates of buffer-local data and global read-only data,
> in which case it can indeed safely run concurrently with other Elisp
> code operating in other buffers.
>
>
>         Stefan
I have a question, most for curiosity, it is is ok :-):

If you reversed the thought and started at "thread-end", could
you make every buffer be owned by some thread. Instead of buffer-first,
would it help to think thread-first? Thus Emacs process would become
more of a thread-scheduller, similar as some web browsers are using
separate process to render each webpage (in its own tab); I think Firfox
uses threads instead of processes. Maybe not the best way to use
multiprocessor cpus as of today, but certainly better then nothing at
all. Dont' know if it possible for Emacs and how underlaying "lisp
machine" is constructed. Maybe each thread could have it's own eval.
But then how would they communicate when they need, since Emacs
buffers often are used together in some way unlike webpages in a browser.

I hope you dont't mind interfering and my curiosity.



  reply	other threads:[~2020-05-15  8:19 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-10 13:47 Questions about throw-on-input Alexander Miller
2020-05-11 14:13 ` Eli Zaretskii
2020-05-11 15:21   ` Stefan Monnier
2020-05-11 16:19     ` Eli Zaretskii
2020-05-11 17:27       ` Stefan Monnier
2020-05-11 17:39         ` Alexander Miller
2020-05-11 18:23           ` Eli Zaretskii
2020-05-11 18:24           ` Stefan Monnier
2020-05-11 19:48             ` Alexander Miller
2020-05-11 20:14               ` Stefan Monnier
2020-05-12 22:33                 ` Alexander Miller
2020-05-13 14:43                   ` Eli Zaretskii
2020-05-13 18:47                     ` Alexander Miller
2020-05-14  8:32                     ` Philipp Stephani
2020-05-14 14:23                       ` Eli Zaretskii
2020-05-14 14:37                         ` Philipp Stephani
2020-05-14 16:56                       ` Drew Adams
2020-05-15  3:21                         ` Richard Stallman
2020-05-15  3:54                           ` Stefan Monnier
2020-05-15  8:19                             ` Arthur Miller [this message]
2020-05-15 15:45                               ` Stefan Monnier
2020-05-15 16:46                                 ` Yuan Fu
2020-05-15 17:31                                   ` Stefan Monnier
2020-05-15 17:50                                     ` yyoncho
2020-05-15 18:44                                       ` Alexander Miller
2020-05-15 18:55                                         ` Stefan Monnier
2020-05-15 19:46                                         ` Philipp Stephani
2020-05-15 18:00                                     ` Andrea Corallo
2020-05-15 17:35                                 ` Arthur Miller
2020-05-15 19:47                                 ` chad
2020-05-16 11:29                                   ` Eli Zaretskii
2020-05-12  2:39           ` Daniel Colascione
2020-05-12 14:37             ` Eli Zaretskii
2020-05-11 18:17         ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2020-05-09 13:09 Alexander Miller
2020-05-10 11:11 ` yyoncho
2020-05-07  7:31 Ivan Yonchovski
2020-05-07 12:36 ` Eli Zaretskii
2020-05-07 14:28   ` Ivan Yonchovski
2020-05-07 21:11   ` yyoncho
2020-05-08  1:58     ` Stefan Monnier
2020-05-08  4:36       ` yyoncho
2020-05-08  4:43         ` yyoncho
2020-05-12  4:15       ` Michael Heerdegen
2020-05-08 10:41     ` Eli Zaretskii
2020-05-08 11:23       ` Ivan Yonchovski
2020-05-08 11:45         ` Eli Zaretskii
2020-05-08 11:55           ` yyoncho
2020-05-08 14:55         ` Stefan Monnier
2020-05-08 18:04           ` yyoncho
2020-05-07 13:49 ` Stefan Monnier
2020-05-07 15:36   ` Ivan Yonchovski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR06MB45260AF5587C677D09D0C7E796BD0@VI1PR06MB4526.eurprd06.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=alexanderm@web.de \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=p.stephani2@gmail.com \
    --cc=rms@gnu.org \
    --cc=yyoncho@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.