On 28/12/2011, at 18:29, Hongli Lai wrote:
> 
> The only thing left that I'm interested in is why Marc thinks
> processes are more efficient than threads. I'm interested in his
> answer because I wish to learn more about how hardware and operating
> systems work.

I run this benchmark again and again, and threads always are (marginally) 
faster than processes, in a core 2 duo, both in OSX and in Ubuntu:

https://github.com/xk/node-threads-a-gogo/blob/master/benchmarks/pi.c

$ gcc -pthread pi.c
$ ./a.out
...
10 processes/threads, looped 5 times.
tThreads(seconds): 0.535, tProcs(seconds): 0.573, ratio:0.933

Perhaps I'm doing it wrong ?
Could you run it on other unixes and post the results ?
-- 
Jorge.
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to