From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5049CC43441 for ; Wed, 14 Nov 2018 12:03:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15E03208E7 for ; Wed, 14 Nov 2018 12:03:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15E03208E7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=angband.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732647AbeKNWGw (ORCPT ); Wed, 14 Nov 2018 17:06:52 -0500 Received: from tartarus.angband.pl ([54.37.238.230]:39630 "EHLO tartarus.angband.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732037AbeKNWGw (ORCPT ); Wed, 14 Nov 2018 17:06:52 -0500 Received: from kilobyte by tartarus.angband.pl with local (Exim 4.89) (envelope-from ) id 1gMttc-0007AF-5A; Wed, 14 Nov 2018 13:03:48 +0100 Date: Wed, 14 Nov 2018 13:03:48 +0100 From: Adam Borowski To: Florian Weimer Cc: Willy Tarreau , "Michael Kerrisk (man-pages)" , Daniel Colascione , linux-kernel , Joel Fernandes , Linux API , Vlastimil Babka , Carlos O'Donell , "libc-alpha@sourceware.org" Subject: Re: Official Linux system wrapper library? Message-ID: <20181114120348.or5id3hzrmltkyvb@angband.pl> References: <20181111081725.GA30248@1wt.eu> <3664a508-ca74-4ff0-39a6-34543194a24e@gmail.com> <20181111111143.GB4189@1wt.eu> <87zhufvntw.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87zhufvntw.fsf@oldenburg.str.redhat.com> X-Junkbait: aaron@angband.pl, zzyx@angband.pl User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kilobyte@angband.pl X-SA-Exim-Scanned: No (on tartarus.angband.pl); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 11, 2018 at 12:46:35PM +0100, Florian Weimer wrote: > A lot of multi-threaded applications assume that most high-level > functionality remains usable even after fork in a multi-threaded > process. How would this be even possible? Currently fork kills all threads (save for the caller). Glibc's manpage also warns: # After a fork() in a multithreaded program, the child can safely call only # async-signal-safe functions (see signal-safety(7)) until such time as it # calls execve(2). Which makes sense as its malloc uses a mutex, and you can't take a breath without a library call using malloc somewhere (or in C++, the language itself). So any functionality remaining usable after fork is pretty strictly limited... Meow! -- ⢀⣴⠾⠻⢶⣦⠀ I've read an article about how lively happy music boosts ⣾⠁⢰⠒⠀⣿⡁ productivity. You can read it, too, you just need the ⢿⡄⠘⠷⠚⠋⠀ right music while doing so. I recommend Skepticism ⠈⠳⣄⠀⠀⠀⠀ (funeral doom metal).