lkml.org 
[lkml]   [2005]   [Nov]   [20]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSun, 20 Nov 2005 12:35:36 +0200
FromMuli Ben-Yehuda <>
SubjectRe: Inconsistent timing results of multithreaded program on an SMP machine.
On Sun, Nov 20, 2005 at 09:28:13PM +1100, Con Kolivas wrote:

> Ok I've had a look at the actual program now ;) Are you timing the time it 
> takes to completion of everything?
> 
> This part of your program:
> 	for (i= 0; i<8; i++)
> 		pthread_join(tid[i], NULL);
> 
> Cares about the order the threads finish. Do you think this might be affecting 
> your results?

I don't see why it should matter. Depending on the order the threads
finish, we will always wait in pthread_join until the last one
finishes, and then do between 0 and 7 more pthread_joins that should
return immediately (since the last one has already finished).

Cheers,
Muli
-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-20 11:41    [from the cache]
©2003-2008