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: semantics of thread-signal Date: Mon, 12 Dec 2016 05:33:22 +0200 Message-ID: <83pokxddod.fsf@gnu.org> References: <871sxe2b8d.fsf@irif.fr> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1481513612 30212 195.159.176.226 (12 Dec 2016 03:33:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2016 03:33:32 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juliusz Chroboczek Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 12 04:33:28 2016 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 1cGHMl-0007Ae-SH for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2016 04:33:27 +0100 Original-Received: from localhost ([::1]:58493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGHMq-00045e-5G for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2016 22:33:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGHM8-00044Z-2D for emacs-devel@gnu.org; Sun, 11 Dec 2016 22:32:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGHM6-0000wy-HE for emacs-devel@gnu.org; Sun, 11 Dec 2016 22:32:48 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGHM6-0000wu-Eb; Sun, 11 Dec 2016 22:32:46 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3689 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cGHM5-0002qM-Hq; Sun, 11 Dec 2016 22:32:46 -0500 In-reply-to: <871sxe2b8d.fsf@irif.fr> (message from Juliusz Chroboczek on Mon, 12 Dec 2016 02:21:38 +0100) 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:210325 Archived-At: > From: Juliusz Chroboczek > Date: Mon, 12 Dec 2016 02:21:38 +0100 > > However, the Emacs thread support has been designed in a way to > later allow more fine-grained concurrency, and correct programs > should not rely on cooperative threading. > > So if thread-signal can be delivered asynchronously, this will cause > trouble when Emacs moves to kernel threads. > > (And this does happen. Viz. SBCL, CCL, ACL, all of which switched from > userspace threading to kernel threads sometime in the last 20 years or > so.) The current implementation already uses kernel threads, it just makes sure only one of them runs Lisp at any given time. All the rest are stuck either in system calls or trying to acquire a global lock.