Subj : Re: threads do not get cpa To : comp.programming.threads,comp.sys.sgi.misc From : azb123 Date : Mon Aug 08 2005 01:29 am > Also note that some implementations of drand48() require a mutex to > protect the internal state of the random number generator. Others > have the generator per-thread, but there's not any easy way to > tell the difference. Thanks, this was exactly the problem! I replaced drand48() by erand48() which has a pointer to a buffer for the internal state as a command line argument, and now I get the desired speed-up. Seems that the internal state was mutex protected and that resulted in a contention problem. However, the original question still remains: the number of processors the program runs on seems unpredictable (at least to me), even after I have added the pthread_setconcurrency() call. When I create 3 threads, the program sometimes gets 3 processors, and sometimes just 1 (the SGI is still mostly empty). Is there anything known about the way the number of processors to be used is determined under IRIX 6.5.24m? Markus .