私のコードで使用されているLinuxのpollシステムコールが、ポーリングで待機しているfdsを取得するというこの固有の問題があります。つまり、ミリ秒ごとにPOLLINを意味します。これにより、CPU 使用率が高くなります。100 ミリ秒のタイムアウトを指定しましたが、役に立たないようです。誰でも代替案を提案できますか。
for (;;) {
ACE_Time_Value doWork(0, 20000);
ACE_OS::sleep(doWork); ----------------------------> Causing low throughput, put to decrease CPU usage / On removing this we see high CPU , but throughput is achieved.
..
.
..
if ((exitCode = fxDoWork()) < 0) {
break;}
}
fxDoWork()
{
ACE_Time_Value selectTime;
selectTime.set(0, 100000);
..
..
..
ACE_INT32 waitResult = ACE_OS::poll(myPollfds, eventCount, &selectTime);-----------------------------> Pollin happens for every milli second/Timeout is not at all useful
..
..
..
}
===============================================================