Re: FreeBSD & Linux

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sun, 8 Nov 1998 13:52:47 +0000 (GMT)


> Can somebody tell me why this program under FreeBSD works much more faster
> then under Linux ?

Fairly obvious if you look at it. FreeBSD favours continuing to schedule
the parent, Linux favours scheduling the child initially. So the Linux
one has a set of processes getting CPU time to execute the busy loops.
The normal case is

fork
exec

or
fork
child:
something short
[sleep or exit]

So the Linux behaviour is a win except in your carefully constructed
program.

Count the loops each of your child processes does.

Alan

-
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/