[Top][All Lists]

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

Re: User interaction from multiple threads

From: Gemini Lasswell
Subject: Re: User interaction from multiple threads
Date: Fri, 31 Aug 2018 14:37:44 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux)

John Shahid <address@hidden> writes:

>> No, it is not.  There are also various other parts of the global state
>> that should be specific to a thread, like the list of condition-case
>> handlers; see the members of 'struct thread_state' as it is defined
>> now, for more examples.
> I am not sure I totally understand the impact of every field in that
> struct has on my proposal.

I'm still developing my understanding of all this as well, and one
important point that wasn't obvious to me at first is that each thread
has its own special binding stack.  This is the m_specpdl field of
thread_state, and is described a bit in lisp.h.  In addition to
unwind-protects and the Lisp backtrace, it keeps track of
dynamically-bound variables, the values of which are local to each

The implication of this for the scenario of having a non-main thread ask
the main thread to prompt on its behalf is that not just buffer-local
variables but other global variables, and anything cl-letf can bind
(including function definitions) would have to be communicated between
the threads.

reply via email to

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