From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: Opportunistic GC Date: Thu, 11 Mar 2021 07:55:30 +0000 Message-ID: References: <83tuplr2l8.fsf@gnu.org> <838s6uohv2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11220"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, Stefan Monnier , Andrea Corallo To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 11 08:58:25 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 1lKGDB-0002rR-5k for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Mar 2021 08:58:25 +0100 Original-Received: from localhost ([::1]:37390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKGDA-0000Yu-14 for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Mar 2021 02:58:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKGB0-0007D5-7b for emacs-devel@gnu.org; Thu, 11 Mar 2021 02:56:10 -0500 Original-Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]:46069) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKGAy-0000ZJ-GJ; Thu, 11 Mar 2021 02:56:09 -0500 Original-Received: by mail-oo1-xc33.google.com with SMTP id n6-20020a4ac7060000b02901b50acc169fso468359ooq.12; Wed, 10 Mar 2021 23:56:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cK9spi4uYQW6GRNH2XkNlkjQNhHKDBKkkOIEEs6UWJ8=; b=izsg0NsFKgcpzMLOrDr3Y9GTtGONHeq0HkL4pt2yt+YYauvX2VIU3EbJHZ95EvufzD rhe1sqINr8lS6uAtfPiSYRlWOZZjzBChTsgWgz9UzHt3HblxZKbvX+wEs8G/oiWO+egg QUUgFANUKZHWS01QXu/8Ca6h1pMgj2k8R0NCdploaFfzhQ3PATXD5i0ueOvRTWBKEY0v ptTBdcGHwFJmaS/spuCP4sUF9D0yewx2vO+lol1Kkhjc6j4+n6LBJj8Cq4sqZ1X6yCtC KL6ui/E7Ddv5FyBXRwQYYG8GybKw3umWTFHBqCvFfnjYv7DR4YtXlxbJ1VME9bO9NUnU a/zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cK9spi4uYQW6GRNH2XkNlkjQNhHKDBKkkOIEEs6UWJ8=; b=CC2uiNEBWeESHhAP5ypFMXcKGH0iVkMs4EqcZcSZBXCgv5QVQTCNMDKsHDkt8qHsJ0 96uTStv5lB/+gMiqtsfW90T1xqMp68cCA7sUnQoGW6bmpmmZXu30Rk3/xRsv341ohqzF qJWP2SjIY1vvP4fBAZtzl9zGkzRHk6N78du5GzCclw50+k/f2NBLHCSDNoRH0opzv23Q 2u8o/1Yt9xc9CLXAevrJ/Nc1bDYO8GYS2j4clKrKx4sTDQYnQIgbRqdbVVbXsd43Z2Oz nIBtKVpbf3ExHD1gJns78vc/1X9j1z5c9mqEOk6vfj7AQ1kKbrtzOJsjaC0udDQ55l4H yfSg== X-Gm-Message-State: AOAM5321TNKJtaQTEjjC1gMU4y2cOtZ20Lgepqw28pCjts9qoFQAMWVn N7WQN82brwb8nCzEwUnfjCj33257oDhVKS/oWGJtFBAm0WA= X-Google-Smtp-Source: ABdhPJy0Al1wqeHyQ/lr8upkitrvPebYF2JZAJboZeO1DUcULa2GlpHCGJhJPe5kEaEh62q7NCjPkmaxeN7W1+k39ys= X-Received: by 2002:a4a:2511:: with SMTP id g17mr5767271ooa.22.1615449366969; Wed, 10 Mar 2021 23:56:06 -0800 (PST) In-Reply-To: <838s6uohv2.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::c33; envelope-from=pipcet@gmail.com; helo=mail-oo1-xc33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:266316 Archived-At: On Wed, Mar 10, 2021 at 8:48 PM Eli Zaretskii wrote: > > 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. GC doesn't throw, though, and we're in a non-returning function. > > > 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? I do intend to do that. I'm currently using write synchronously, and I don't see a problem with that. > or read some stuff from the parent? Not right now, no. > Doesn't that mean you'd need to > call pselect? Not at present, no. But even if I did, how would that make mutexes relevant? > > Everything should be fine... > Famous last words ;-) Precisely. Pip