From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Creating a separate GUI thread for NS Date: Sat, 27 Jan 2018 13:33:19 +0200 Message-ID: <83h8r7k03k.fsf@gnu.org> References: <20180127111457.GA66552@breton.holly.idiocy.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1517052736 31051 195.159.176.226 (27 Jan 2018 11:32:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 Jan 2018 11:32:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 27 12:32:12 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1efOiQ-0007aR-CY for ged-emacs-devel@m.gmane.org; Sat, 27 Jan 2018 12:32:10 +0100 Original-Received: from localhost ([::1]:42971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efOkO-0000eK-V6 for ged-emacs-devel@m.gmane.org; Sat, 27 Jan 2018 06:34:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efOja-0000dC-Ra for emacs-devel@gnu.org; Sat, 27 Jan 2018 06:33:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1efOjW-0003Ko-Td for emacs-devel@gnu.org; Sat, 27 Jan 2018 06:33:22 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efOjW-0003Kg-Pz; Sat, 27 Jan 2018 06:33:18 -0500 Original-Received: from [176.228.60.248] (port=2595 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1efOjV-0003dm-US; Sat, 27 Jan 2018 06:33:18 -0500 In-reply-to: <20180127111457.GA66552@breton.holly.idiocy.org> (message from Alan Third on Sat, 27 Jan 2018 11:14:57 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:222264 Archived-At: > Date: Sat, 27 Jan 2018 11:14:57 +0000 > From: Alan Third > > The sensible thing to do would be to move the run loop to its own > thread. I believe we do something similar on Windows. On MS-Windows, the separate thread runs the GUI input message pump. > 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. Does the text-mode session on NS use SIGINT for C-g? (Caveat: I know nothing about NS.)