Thread performance (was Re: dynamic context transitions)

tridge at samba.org tridge at samba.org
Sat Dec 4 22:30:09 GMT 2004


David,

 > 	That was the case with Solaris 7: it was changed to
 > 	one kernel thread per user thread in 8, vaguely similar
 > 	to the Linux one process-equivalent per thread.

ok

 > ...
 > 	The Solaris model is to assume programs are unthreaded, and 
 > 	make it the programmer's responsibility to chose the thread-safe
 > 	and high-threaded-performance interfaces, and no others. There
 > 	are no locks or warnings about using a thread-unsafe libc function,
 > 	it just fails at runtime.

lets test that theory:

bash-2.03# uname -a
SunOS sun1 5.8 Generic_108528-01 sun4u sparc SUNW,Ultra-60

bash-2.03# ./thread_perf 10 malloc

Running test 'malloc' with 10 tasks
Threads    10.18 +/- 3.87 seconds
Processes   1.51 +/- 0.18 seconds


So, on Solaris 8 malloc is 7x slower with threads than with
processes. Would you like to try a newer version of Solaris and get
back to me with the results?

See http://samba.org/ftp/unpacked/junkcode/thread_perf.c

I know there are methods on Solaris for making malloc go fast with
threads, but even with all those go-faster methods it will at best be
able to approach the speed of processes. For this sort of thing, you
can't beat hardware with software.

Cheers, Tridge


More information about the samba-technical mailing list