ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:103209] Re: [Ruby master Feature#5446] at_fork callback API
Date: Sun, 4 Apr 2021 21:17:12 +0000	[thread overview]
Message-ID: <20210404211712.GA30128@dcvr> (raw)
In-Reply-To: <20210404204048.GA31297@dcvr>

Eric Wong wrote:
> fork() seems hacky now that Ractor exists, and
> Process.spawn/popen/system use vfork (along with cloexec being
> the default)

<snip>

> With Ractor, perhaps fork() shouldn't be encouraged/promoted, anymore.

Expanding on that:  fork() is a middle-of-the-road approach;
like roadkill, it gets run over from both sides.

Ractor uses less memory, starts faster, and makes sharing data easier.

Process.spawn can give the ultimate in isolation and data safety
(at the expense of startup performance).

fork() has high/unpredictable memory use and performance
dependent on CoW (which is still tricky to predict and control).
It also has difficult and expensive data sharing; along with
potential for inadvertant data leaks.


By the time users adopt a new Ruby API for atfork, I think
they'd be better served by moving to Ractor, instead.

  reply	other threads:[~2021-04-04 21:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-5446.20111014111058.724@ruby-lang.org>
2021-04-03 14:16 ` [ruby-core:103197] [Ruby master Feature#5446] at_fork callback API jean.boussier
2021-04-04  5:34   ` [ruby-core:103199] " Eric Wong
2021-04-03 14:17 ` [ruby-core:103198] " jean.boussier
2021-04-04 10:52 ` [ruby-core:103202] " eregontp
2021-04-04 20:40   ` [ruby-core:103208] " Eric Wong
2021-04-04 21:17     ` Eric Wong [this message]
2021-04-04 10:55 ` [ruby-core:103203] " eregontp
2021-04-04 18:40 ` [ruby-core:103205] " jean.boussier
2021-04-04 18:44 ` [ruby-core:103206] " jean.boussier
2021-04-04 19:19 ` [ruby-core:103207] " daniel
2021-04-04 21:55 ` [ruby-core:103210] " jean.boussier
2021-04-04 22:26 ` [ruby-core:103212] " jean.boussier
2021-04-05  3:07 ` [ruby-core:103235] " daniel
2021-04-06 10:50 ` [ruby-core:103254] " jean.boussier
2021-04-08  8:31 ` [ruby-core:103297] " ivo.anjo
2021-04-12  5:30 ` [ruby-core:103393] " mame
2021-04-12  6:52 ` [ruby-core:103397] " jean.boussier
2021-04-12  7:52 ` [ruby-core:103399] " mame
2021-04-12  8:09 ` [ruby-core:103401] " jean.boussier
2021-04-13 14:30 ` [ruby-core:103426] " mame

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210404211712.GA30128@dcvr \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).