
5 Feb
2008
5 Feb
'08
9:07 p.m.
I have tried threadpool. It is my understanding that the code fragment below should run in constant time independent of the number of threads (assuming that the ³Test::operator()² method runs in constant time). However, I observe an increase in runtime as I increase the pool size from say 1 to 5. Any thoughts on this? James
int main() { const int nt = 5; const int nit = 10000;
time_t t1 = clock();
boost::threadpool::pool p(1); for( int j=0; j
std::cout << "t=" << difftime(clock(), t1) << std::endl; return 0; }