|
|
|
Help me, Obi Wan.
Linus
On Tue, 24 Feb 2004, Timothy Miller wrote:
>
> Fortunately, Linus is very antithetical to many other cult figures in
> that he is very much NOT a psychopath. :)
I'm happy you put it that way, because otherwise I'd have had to take out
my chain saw and run around naked trying to kill you.
Mwhahhahhaahaa!
Linus
On Tue, Feb 24, 2004 at 01:31:26PM -0800, Linus Torvalds wrote:
> > Fortunately, Linus is very antithetical to many other cult figures in
> > that he is very much NOT a psychopath. :)
>
> I'm happy you put it that way, because otherwise I'd have had to take out
> my chain saw and run around naked trying to kill you.
If you listen carefully, you'll hear the sound of thousands of Linux hackers
trying to scratch out their minds-eyes at that image. 8-)
Dave
qmail is a piece of crap. The source code is completely unreadable, and it
seems to think that "getpid()" is a good source of random data. Don't ask
me why.
It literally does things like
random = now() + (getpid() << 16);
and since there isn't a single comment in the whole source tree, it's
pointless to wonder why. (In case you wonder, "now()" just does a
"time(NULL)" call - whee.).
I don't understand why people bother with it. It's not like Dan Bernstein
is so charming that it makes up for the deficiencies of his programs.
But no, even despite the strange usage, this isn't a performance issue.
qmail will call "getpid()" a few tens of times per connection because of
the wonderful quality of randomness it provides, or something.
This is another gem you find when grepping for "getpid()" in qmail, and
apparently the source of most of them:
if (now() - when < ((60 + (getpid() & 31)) << 6))
Don't you love it how timeouts etc seem to be based on random values that
are calculated off the lower 5 bits of the process ID? And don't you find
the above (totally uncommented) line just a thing of beauty and clarity?
Yeah.
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.
Linus
In engineering, it's called over-desiging, and it's stupid. In law, it's
called "billable hours", and it's encouraged.
Linus
And no, the above has never been compiled or tested, and I wrote it with
one eye closed, while drinking heavily and experimenting with some funky
'shrooms. So caveat emptor.
Linus
|