c - why select leads to high cpu sys load? -
- top: cpu load of process 100%, , 90% sys
- strace: system calls select
- select: select(11, [8, 10], null, null, {0, 10}) = 0 (timeout), fd 8 , fd 10 both fifo
- vmstat -n 5: system cs , system in low
- linux: 2.6.16.60
- cpu: 4 cores, intel(r) xeon(r) cpu e5504 @ 2.00ghz
how explain it? , have changed timeout of select 1s, cpu sys load changed 85%, why?
have changed nfds of select highest fd plus one, still high cpu sys load
edit -- problem solved
bug has nothing select, third argument abstime of pthread_mutex_timedwait absolute time, used relative time mistake, caused high cpu sys load.
and why pthread_mutex_timedwait causes high cpu sys load, not high cpu usr load?
strace: see select system call, no others
you may have bad (disconnected) descriptor. main reason such load on read select.
you may have data available, never read it. same situation.
you might heavy between of select calls.
if select returns 0, problem not in select call. elsewhere.
Comments
Post a Comment