This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Caching of PID/TID after fork
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Robert Święcki <robert at swiecki dot net>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 07 Oct 2016 21:38:45 +0200
- Subject: Re: Caching of PID/TID after fork
- Authentication-results: sourceware.org; auth=none
- References: <CAP145pj+yVz_7ZF8_dNqZ2NE22A_O5QyT195Gy0TgvKq1j3skw@mail.gmail.com>
* Robert Święcki:
> Thefore I'd like to ask for one of the following solutions:
>
> 1. Don't cache PID/TID
>
> 2. Provide some kind of symbol, which would force for TID/PID to be
> reloaded in glibc.
I think we need a different design.
For example, when you clone a process, you really want that all
cryptographic random number generators are reinitialized. Making this
depend on getpid does not really work, so we need a more general
solution.
The other question I have is whether we talk about clone-as-fork
exclusively. Introducing a new thread into the process on which
non-free-standing code can run using clone is a different matter
altogether.