Here are some results from running "time ./forktest whatever" which does
10,000 iterations.
Sun Ultra Enterprise 2 with 2* 200MHz UltraSPARC CPUS
Solaris 2.6
fork:
real 1m42.296s
user 0m16.690s
sys 1m36.190s
pthread:
real 0m0.564s
user 0m0.540s
sys 0m0.040s
Sun Ultra 5 with 270MHz UltraSPARC CPU
Solaris 2.6
fork:
real 2m21.365s
user 0m19.270s
sys 1m45.680s
pthread:
real 0m0.548s
user 0m0.520s
sys 0m0.030s
IBM ThinkPad 380XD with 233MHz PentiumMMX CPU
Linux 2.2.10
fork:
real 0m21.727s
user 0m3.300s
sys 0m18.230s
pthread:
real 0m3.447s
user 0m0.930s
sys 0m2.510s
clone3:
real 0m0.786s
user 0m0.080s
sys 0m0.710s
Copyright © 1999 Russell
Coker, may be distributed freely.