From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.devel
Subject: Re: Opportunistic GC
Date: Mon, 8 Mar 2021 17:14:51 +0100
Message-ID:
References:
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
logging-data="32949"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: Eli Zaretskii , Stefan Monnier ,
Pip Cet , Emacs developers
To: Andrea Corallo
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 08 17:16:38 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 1lJIYg-0008Tp-6D
for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Mar 2021 17:16:38 +0100
Original-Received: from localhost ([::1]:51760 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1lJIYf-0002RV-8n
for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Mar 2021 11:16:37 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35520)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1lJIXE-0001u0-R1
for emacs-devel@gnu.org; Mon, 08 Mar 2021 11:15:08 -0500
Original-Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]:34269)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1lJIXB-0007E1-2e; Mon, 08 Mar 2021 11:15:08 -0500
Original-Received: by mail-oi1-x235.google.com with SMTP id x78so11540360oix.1;
Mon, 08 Mar 2021 08:15:03 -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:content-transfer-encoding;
bh=skzgMfFL0QWW+YAw4aLGLmSxVmrTI2THOdlSwlkk3ro=;
b=L1dKlpMgYEoLZ40mwfuoW+eZ0XVqpSW9p7guHeg7m8Opu+xh6wj7kjgCVgp3WjPsus
7420BkN70AHt+Qhp30tScxEgFVt6K/euV2WscjSVje9XfVavbeSpyzNdO1ZNXhAP0wrn
NTvfH7oGjxvvXaUriX6hvcmp8TYYq0PRpXyWibaqWEunR+4CFfH6QjrjXV5TKsftfEuM
H0ynipgqMSl5v4BZyGP/5FZH2hTHlyvUvgQl+STlcugLJUkjC2gx0ibRLDysHBnR7/UA
FXhzK7xJiO+E92SR7irlgmrIHzNH7bUJMB/RZQIGVyo5UnBl9Jip96e5CKW1+qWVEMyY
worw==
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:content-transfer-encoding;
bh=skzgMfFL0QWW+YAw4aLGLmSxVmrTI2THOdlSwlkk3ro=;
b=Y+Lygm8zp9GE8R2ufHcGpy0ucAlcjq7HdmdFIjsm3IuSHHm0FlPdBbWyvVwNZ9uNUe
3MkLqd+nTVR53cr+UMVqprea12zTM5qungrgrqZ9XtjEopC6r4Zgy87/sCJm/nz/VXfN
3rQ1o/4JE4qOqODbuZSqOsD8MkxxRvOtxpoPlAr89LfEW7lJQuVAO6o5IW8yjTNEH3bp
oxxDsRi6RDWOi/LxG3SdhTZzDMaAEun/YeGBqXyH2caOsdsL6IhNZL0AZdrPRIW2AUOP
TsWZ3zHBjpMmHVsQbX1jWgbLkQ231qYsGk6bRkneMLDXlUyAu8MELhJ5nYRCYZB1g4wi
JVVQ==
X-Gm-Message-State: AOAM530BOX7xQ5mNEt30x+2svo6xoHAXLmRnvqfNT7LO5ZRTsG8EMbgP
Q1k+t2pXF24i7BQWi0xEOOrykab8JhYdBq89Ths=
X-Google-Smtp-Source: ABdhPJyrkRIOGStnSzAuTF9x0a61Z3k7N7zlCzeyfweD4K1ZXY09sPpbQZ6Y/FczX8nV2BrJ7p4o6VxbIa4/dT09Cdw=
X-Received: by 2002:a05:6808:d47:: with SMTP id
w7mr17619396oik.150.1615220102439;
Mon, 08 Mar 2021 08:15:02 -0800 (PST)
In-Reply-To:
Received-SPF: pass client-ip=2607:f8b0:4864:20::235;
envelope-from=p.stephani2@gmail.com; helo=mail-oi1-x235.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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:266202
Archived-At:
Am Mo., 8. M=C3=A4rz 2021 um 16:53 Uhr schrieb Andrea Corallo via Emacs
development discussions. :
>
> Pip Cet writes:
>
> > On Mon, Mar 8, 2021 at 2:01 PM Andrea Corallo wrote:
> >> Pip Cet writes:
> >>
> >> > On Mon, Mar 8, 2021 at 3:37 AM Stefan Monnier wrote:
> >> >> I've been running with the code below recently to try and see if
> >> >> opportunistic GC can be worth the trouble.
> >> >
> >> > Just a random idea: What if we exploit the fact most people have mor=
e
> >> > than one CPU core these days, garbage-collect in a separate fork()ed
> >> > process, then do only the sweeping in the main process?
> >>
> >> It's an interesting concept, I thought about something similar in the
> >> past but, I've two questions:
> >>
> >> Are we really sure that a non trivial process can long survive
> >> or work as expected after being forked?
> >
> > I believe that, on all systems where bash works, we can expect fork()
> > to behave.
>
> I also expect fork will work, I'm more wondering about interaction with
> sockets file descriptors or anything else in our codebase and/or in
> libraries we have loaded.
>
> I've read in the past this is an issue in practice in non trivial code
> and that, because the typical use of fork () nowadays is just to run
> afterward exec (), operating in the grey between the two was not really
> a good idea. But I don't have the reference now and if you say it works
> I've no reasons not to trust you.
The restriction is that you can only call async-signal-safe functions
in subprocesses before exec. See e.g. the man page for fork on
GNU/Linux.