Caching of PID/TID after fork

Zack Weinberg zackw@panix.com
Fri Oct 7 00:43:00 GMT 2016


On Thu, Oct 6, 2016 at 8:42 PM, Zack Weinberg <zackw@panix.com> wrote:
> On Thu, Oct 6, 2016 at 5:35 PM, Robert Święcki <robert@swiecki.net> 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



More information about the Libc-alpha mailing list