Re: FreeBSD & Linux

Tim Smith (tzs@tzs.net)
Sun, 8 Nov 1998 09:49:59 -0800 (PST)


On Sun, 8 Nov 1998, Alan Cox wrote:
> Fairly obvious if you look at it. FreeBSD favours continuing to schedule
> the parent, Linux favours scheduling the child initially. So the Linux

Is that a 2.1.x thing? On my 2.0.34 system, the parent executes first
after a fork, it appears. I'm measuring like this:

#define cc(var) asm("rdtsc" : "=eax" (var) :: "edx" )
...
long before, after;

cc(before);
if ( fork() == 0 ) {
cc(after);
printf( "\nchild: %d ==> %d (%d)\n", before, after, after-before );
} else {
cc(after);
printf( "\nparent: %d ==> %d (%d)\n", before, after, after-before );
}

--Tim Smith

ps: anyone have a better inline asm for rdtsc? The above was constructed
after minimal reading of the gcc info files. I'd like something that looks
like a function that returns the time ("var = cc()").

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/