Eli Zaretskii <address@hidden
> schrieb am Do., 24. Mai 2018 um 18:38 Uhr:
> Date: Wed, 23 May 2018 22:21:29 +0100
> From: Alan Third <address@hidden>
> Cc: Nick Helm <address@hidden>, address@hidden,
> address@hidden, address@hidden
> The main problem I have is things coming in the opposite direction. I
> don’t know if W32 is the same, but we can only run GUI related code in
> the main thread.
What do you mean by "GUI code" here?
Code that interacts with the windowing system.
> If we separate the Lisp thread and the NS run loop thread, then code
> called from Lisp can’t directly interact with the NS GUI code, it
> has to be dispatched to the NS run loop thread.
The w32 build has a similar problem, and it solves it by setting up
message queue between the main and the input threads. Messages are
sent between the two threads when needed, and the Windows native
messages are used in the opposite direction. So when one thread needs
something done by the other thread, it sends the appropriate message,
waits for a response, then continues (and sometimes it doesn't have to
wait for any response, it depends on the case).
Can NS use some similar machinery?
Most likely yes (because UI toolkits always work that way). The to-be-written GTK+ terminal should use the same mechanism.
What's the "input thread" in the Windows implementation? At least on macOS the UI thread (i.e. the thread that creates windows and handles events) must be the main thread, which means the Lisp interpreter thread(s) should become background threads.