unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "John Wiegley" <johnw@gnu.org>
Cc: pogonyshev@gmail.com, emacs-devel@gnu.org
Subject: Re: Make computational threads leave user interface usable
Date: Wed, 01 Nov 2017 22:03:54 +0200	[thread overview]
Message-ID: <831slhsr4l.fsf@gnu.org> (raw)
In-Reply-To: <m2h8uduavh.fsf@newartisans.com> (johnw@gnu.org)

> From: "John Wiegley" <johnw@gnu.org>
> Date: Wed, 01 Nov 2017 11:12:02 -0700
> Cc: Emacs developers <emacs-devel@gnu.org>
> 
> This would introduce the sort of indeterminacy that raised so much objection
> to threading support last year. I'm fairly opposed to pre-emptive threading
> until we've heard from the field about the success of green threading.

I agree.  I would even say it more bluntly: I don't believe the
current threading code can be extended to pre-emptive threads so
easily.  Much more redesign and reimplementing of several core
internals will be needed before it will become possible to write
reliable programs with pre-emptive threading.

How do I know? by the amount of gray hair we needed to acquire and the
amount of sweat and blood we invested before the current much simpler
model got to what we have now, which is still not perfect even for the
limited features it was supposed to support.

>     (make-thread (lambda ()
>                    (dotimes (n 10000000)
>                      (thread-yield)
>                      (when (= (% n 1000000) 0)
>                        (message "%s" n)))
>                    (message "done")))
> 
> This gives the UI access to Emacs again, but otherwise keeps executing if no
> other threads need control.

I think we currently lack intermediate infrastructure to make writing
such programs easily.  Right now, a Lisp programmer who wants to take
advantage of these features needs to jump through many hoops and
overcome some counter-intuitive/surprising obstacles and issues.

Volunteers, where are you?



  reply	other threads:[~2017-11-01 20:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 15:06 Make computational threads leave user interface usable Paul Pogonyshev
2017-11-01 15:10 ` Paul Pogonyshev
2017-11-01 18:12 ` John Wiegley
2017-11-01 20:03   ` Eli Zaretskii [this message]
2017-11-01 21:19   ` Paul Pogonyshev
2017-11-01 21:47     ` John Wiegley
2017-11-03 15:50     ` Stefan Monnier
2017-11-01 19:10 ` Noam Postavsky
2017-11-01 20:16   ` Eli Zaretskii
2017-11-01 20:26     ` Noam Postavsky

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=831slhsr4l.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=johnw@gnu.org \
    --cc=pogonyshev@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).