unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: guix-devel@gnu.org
Subject: Re: Hack the (init) system!
Date: Fri, 04 Sep 2015 14:08:02 +0200	[thread overview]
Message-ID: <87a8t2wfod.fsf@gnu.org> (raw)
In-Reply-To: <874mjb0wvm.fsf@netris.org> (Mark H. Weaver's message of "Thu, 03 Sep 2015 21:57:33 -0400")

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:

[...]

>> I’m tempted to just commit that.  There are shortcomings: (1) the REPL
>> server runs in a thread and threads + fork don’t go together well
>> (although in practice dmd only does fork followed by exec, so it’s OK),
>
> Unfortunately, it's only okay if the code between fork and exec in the
> child process is carefully written to execute only "async-signal-safe"
> operations.

Right (I was not suggesting that the hack is robus, rather that it’s
kinda OK “in practice”, notably because I would only start it once all
the ‘fork’ calls have been made.)

> So, I think we have two choices:
>
> 1. Avoid threads in dmd, i.e. either refrain from adding this REPL
>    server feature, or re-implement it in a way that avoids threads.
>
> 2. Avoid 'primitive-fork' in dmd, which means reimplementing
>    'fork+exec-command' in C; reimplementing the code where we currently
>    use 'primitive-fork' within various guix service definitions; and
>    documenting that users should never use 'primitive-fork' in their
>    services.  If we choose this route, we should probably disable
>    'primitive-fork' somehow, or at least have it issue a stern warning.
>
> I don't think that we should add a set of features to dmd that will make
> it fundamentally unreliable in a way that cannot be fixed.
>
> What do you think?

Agreed, of course.  I think #1 is the way to go.

Thanks,
Ludo’.

  reply	other threads:[~2015-09-04 12:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03 21:02 Hack the (init) system! Ludovic Courtès
2015-09-04  0:25 ` Thompson, David
2015-09-04 12:05   ` Ludovic Courtès
2015-09-04 13:05     ` Thompson, David
2015-09-04  0:54 ` Thompson, David
2015-09-04  1:57 ` Mark H Weaver
2015-09-04 12:08   ` Ludovic Courtès [this message]
2015-09-25 23:04     ` Christopher Allan Webber
2015-09-26 13:02       ` Ludovic Courtès
2015-09-26 17:30         ` Christopher Allan Webber
2015-09-28  9:13       ` Andy Wingo
2015-09-28 13:42         ` Taylan Ulrich Bayırlı/Kammer
2015-09-28 13:43         ` Thompson, David
2015-09-28 15:01         ` Christopher Allan Webber

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-all from there: mbox

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87a8t2wfod.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=mhw@netris.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).