Eli Zaretskii <eliz@gnu.org> schrieb am Sa., 27. Jan. 2018 um 12:34 Uhr:

> The problem is that Cocoa insists the run loop *must* be run on the
> main thread, and Emacs also insists that *it* runs on the main thread.
>
> Is there a way to get Emacs to run on a child thread? Is it just a
> case of resetting main_thread_id in sysdep.c?

You should consider which thread gets the signals (or their
equivalents).  Emacs currently assumes its the main thread, and that's
what you see in sysdep.c.  But some other traces of this assumption
are elsewhere, so you should carefully review any code that is related
to signals.

Could we switch signal processing to a simpler model, such as a background thread and sigwait?