Reputation: 1351
how to explain it? and i have changed the timeout of select to 1s, the cpu sys load changed to 85%, why?
have changed nfds of select to the highest fd plus one, still high cpu sys load
EDIT -- Problem solved
The bug has nothing to do with select, the third argument abstime of pthread_mutex_timedwait is absolute time, but i used relative time by mistake, which caused the high cpu sys load.
And why pthread_mutex_timedwait causes high cpu sys load, not high cpu usr load?
strace: only see select system call, no others
Upvotes: 0
Views: 3742
Reputation: 5163
You may have a bad (disconnected) descriptor. Usually that is the main reason for such load on read select
.
You may have data available, but never read it. Same situation.
You might do something really heavy between of select
calls.
If your select
always returns 0
, then the problem is not in select
call. Its elsewhere.
Upvotes: 0