From: "John Wiegley" <johnw@gnu.org>
To: Paul Pogonyshev <pogonyshev@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Make computational threads leave user interface usable
Date: Wed, 01 Nov 2017 14:47:41 -0700 [thread overview]
Message-ID: <m2wp39pt6q.fsf@newartisans.com> (raw)
In-Reply-To: <CAG7BpapO_vyX-v+8tSg7r9q60MHSdvZU+GY5Me26LZrRxYB95A@mail.gmail.com> (Paul Pogonyshev's message of "Wed, 1 Nov 2017 22:19:39 +0100")
>>>>> "PP" == Paul Pogonyshev <pogonyshev@gmail.com> writes:
PP> What if this auto-yield is made optional? It sort of already is in the
PP> patch, but the default value could be made nil. Then, you can activate it
PP> downstream by using (let ((thread-auto-yield-after ...) ...), but normally
PP> it is not active. So, activating becomes your own decision, not something
PP> sneaked upon you.
Here's what I would accept: A macro to inject (thread-yield) calls into
function definitions. This is extremely low-impact (just a new macro), works
with the existing implementation, and offers the semantics you're asking for
in a way that's good enough for now.
Of course, it only works for code defined using the macro, but I actually
don't _want_ a patch that changes code written to be cooperative into code
that evaluates pre-emptively. If, on the other hand, you want to define a set
of thread functions that allow full pre-emption by auto-injecting yield
points, then I believe such a macro would serve this need.
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
next prev parent reply other threads:[~2017-11-01 21:47 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
2017-11-01 21:19 ` Paul Pogonyshev
2017-11-01 21:47 ` John Wiegley [this message]
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=m2wp39pt6q.fsf@newartisans.com \
--to=johnw@gnu.org \
--cc=emacs-devel@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).