emacs-devel
[Top][All Lists]
Advanced

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

Re: Make computational threads leave user interface usable


From: Eli Zaretskii
Subject: Re: Make computational threads leave user interface usable
Date: Wed, 01 Nov 2017 22:03:54 +0200

> From: "John Wiegley" <address@hidden>
> Date: Wed, 01 Nov 2017 11:12:02 -0700
> Cc: Emacs developers <address@hidden>
> 
> 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 via email to

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