From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Opportunistic GC Date: Wed, 10 Mar 2021 22:48:17 +0200 Message-ID: <838s6uohv2.fsf@gnu.org> References: <83tuplr2l8.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="695"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, akrl@sdf.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 10 21:51:54 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lK5oA-000Adz-Lg for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Mar 2021 21:51:54 +0100 Original-Received: from localhost ([::1]:50270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lK5o9-00024C-NY for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Mar 2021 15:51:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lK5kk-00061V-Lq for emacs-devel@gnu.org; Wed, 10 Mar 2021 15:48:22 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44048) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lK5kj-000818-1J; Wed, 10 Mar 2021 15:48:21 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2840 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lK5kg-0002e5-1J; Wed, 10 Mar 2021 15:48:19 -0500 In-Reply-To: (message from Pip Cet on Wed, 10 Mar 2021 20:25:04 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266306 Archived-At: > From: Pip Cet > Date: Wed, 10 Mar 2021 20:25:04 +0000 > Cc: Stefan Monnier , Andrea Corallo , emacs-devel@gnu.org > > > There are other potential complications with this, related to > > threads. Posix says 'fork' only copies a single thread, the one that > > called it, but what if that single thread is not the main thread? > > Why would that be a problem? Well, I mentioned one aspect that should be considered below. There are probably others, as we never intended for one of these threads to be left alone. E.g., what about error handling? non-main threads have a very simplistic one. > > In > > Emacs nowadays a non-main Lisp thread can trigger GC. What happens to > > the mutexes we use in the threads machinery when we fork like that? > > In the child, they're irrelevant They are? Don't you intend to send the results to the parent process? or read some stuff from the parent? Doesn't that mean you'd need to call pselect? > Everything should be fine... Famous last words ;-)