Subj : Re: threads do not get cpa To : comp.programming.threads,comp.sys.sgi.misc From : ptjm Date : Sun Aug 07 2005 05:35 pm In article <1123428099.078544.129690@g49g2000cwa.googlegroups.com>, wrote: % I also noticed another oddity: When I run my program with more threads % it's slower than with just a single one, e.g.: Perhaps you spend more time contending for stderr and CurrentQuery than you spend performing calculations. Try saving up the output in a (pre-allocated) buffer and spitting it out in one go at thread exit time, and pre-allocating the queries (i.e., have each thread step through the list in steps of nthreads, rather than contending for a mutex after each query. -- Patrick TJ McPhee North York Canada ptjm@interlog.com .