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: John Wiegley
Subject: Re: Make computational threads leave user interface usable
Date: Wed, 01 Nov 2017 14:47:41 -0700
User-agent: Gnus/5.130016 (Ma Gnus v0.16) Emacs/26.0 (darwin)

>>>>> "PP" == Paul Pogonyshev <address@hidden> 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



reply via email to

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