Subj : Re: threads do not get cpa To : comp.programming.threads,comp.sys.sgi.misc From : Joe Seigh Date : Sun Aug 07 2005 01:10 pm azb123@planet.nl wrote: > Joe, > thanks for the suggestion! > I've added the following lines to my code: > > if ((r=pthread_setconcurrency(nthreads))) > fprintf(stderr,"Could not set concurrency: %d!\n",r); > > The results are a little bit erratic, sometimes I get the expected > behavior, i.e. activity_in_top = nthreads*100, and sometimes I get less > than the expected activity. All this is on a SGI Octane with IRIX > 6.5.24m (16cpus), no other applications running. I am little bit > puzzled now, could that be a strange effect of the IRIX scheduler? > > I also noticed another oddity: When I run my program with more threads > it's slower than with just a single one, e.g.: > > nthreads cpu-time wall-clock time > 1 30 30 > 2 140 70 > 3 452 154 > > Do you have further suggestions? > Could be lock contention from either the locks in your program or ones in a routine you are calling. Also if you were running Linux I'd suspect Linux's brain damaged signaling but you're using IRIX which I don't know if it has the same problem. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. .