From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92667 invoked by alias); 7 Oct 2016 00:43:43 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 92647 invoked by uid 89); 7 Oct 2016 00:43:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mailbackend.panix.com X-Gm-Message-State: AA6/9RlZ0USVQi9maHBLpaKhMNNP98EBBA8uDSXbI2opEGLFAMXHPjECfcmYhsPyyRlpGo1ro9ZOZyztWBhI3w== X-Received: by 10.28.88.70 with SMTP id m67mr15562750wmb.14.1475801009888; Thu, 06 Oct 2016 17:43:29 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20161006172631.GO19318@brightrain.aerifal.cx> <20161006180514.GP19318@brightrain.aerifal.cx> From: Zack Weinberg Date: Fri, 07 Oct 2016 00:43:00 -0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Caching of PID/TID after fork To: =?UTF-8?B?Um9iZXJ0IMWad2nEmWNraQ==?= Cc: Adhemerval Zanella , GLIBC Devel Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2016-10/txt/msg00161.txt.bz2 On Thu, Oct 6, 2016 at 8:42 PM, Zack Weinberg wrote: > On Thu, Oct 6, 2016 at 5:35 PM, Robert =C5=9Awi=C4=99cki wrote: >> Maybe providing something like fork_with_flags(int flags) would work >> here? Seems that most (all?) the projects that I've seen, which use >> clone() directly and had problems with caching of TID/PID, basically >> need fork with some flags (mainly of the CLONE_NEW* type). Such >> function would deal with tid/gid/locks/pthread_atfork as fork does, >> but would also OR the provided flags with the canonical ones? > > I've thought for quite some time that there should be a second > clone-wrapper in glibc that doesn't ask for a new stack. It might be > better to call it something with "clone" in the name, but I don't care > terribly much. Meant to say: in addition to the PID/TID caching issues, this would be able to run pthread_atfork() handlers. zw