From: Stef B. <st...@gm...> - 2012-03-12 16:36:22
|
2012/3/12 Baoxu Shi <bxs...@gm...>: > Hi you guys, > > > and without add the thread, it runs pretty well, but after I add this thread in > > pthread_create(&tid, NULL, test, NULL); // function test is just a while(1){} > > it get slower(Read a 100M file, without this thread it is 40s, and with that it is nearly 100s) He, this is just so logical, the extra test thread is running a endless loop, no wait points, taking all of the resources, well at least the cpu power. Use a different technique to test the extra thread. a while loop with a condition variable? Stef |