Big array of size 1mega caused high CPU?
问题 I have a multithreaded server application. This application receives data from sockets then handles these data like unpacking package, adding to data queue, etc, the function is as below. This function is called frequently. There is a select statement and if it finds there is data it will call this function to receive): //the main function used to receive //file data from clients void service(void){ while(1){ .... struct timeval timeout; timeout.tv_sec = 3; ... ret = select(maxFd+1, &read_set