Re: clone() <-> getpid() bug in 2.6?

From: Bernd Eckenfels
Date: Sun Jun 06 2004 - 04:53:04 EST


In article <Pine.LNX.4.58.0406052244290.7010@xxxxxxxxxxxxxxx> you wrote:
> It literally does things like
>
> random = now() + (getpid() << 16);

It does that for the unique filenames and id stamps (maildir format and
message ids). But it should be easy to replace this with a cached getpid
result, if this is realy a performance problem. On a traditional unix system
pid and timestamp should be locally unique for non threaded applications.

> Anyway, you did find something that used more than a handful of getpid()
> calls, but no, it doesn't qualify as performance-critical, and even
> despite it's peyote-induced (or hey, some people are just crazy on their
> own) getpid() usage, it's not a reason to have a buggy glibc.

I wonder if it easyly would be possible to cache the getpid() result in some
thread local segment. Is there any, which is present for all clone flags?
Not tha I care much about this unneeded glibc optimizsation, but more out of
curiousity about the new threadind functionality.

Greetings
Bernd
--
eckes privat - http://www.eckes.org/
Project Freefire - http://www.freefire.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/