Hi,
I found my program consumes about 4% CPU on DM365 even the process is in
idle(waiting in select()), but the same program consumes about 0% on
DM6446/DM355 with DVSDK 1.3(kernel 2.6.10).
To confirm the problem, I write a small program, the source code is here.
When the timeout of each select() /poll() is set to 1ms, the test process
consumes 4%~8% CPU.
The compiler is gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203), the kernel
is 2.6.32.
I have tested on latest davinci kernel tree 2.6.38 and got the same result
#include <sys/time.h>
#include <stdio.h>
#include <unistd.h>
//#include <sys/types.h>
//#define USE_SELECT
#ifdef USE_SELECT
#include <sys/select.h>
#else
#include <poll.h>
#endif
void main()
{
#ifdef USE_SELECT
struct timeval tv;
while(1) {
tv.tv_sec = 0;
tv.tv_usec = 1*1000;
if(0 !=select(1,NULL,NULL,NULL,&tv)) {
printf("error \n");
}
// usleep(1*1000);
}
#else
int timeout;
while(1) {
timeout=1;
poll(NULL,0,timeout);
// printf("timeout\n");
}
#endif
}
Regards
lcj
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source