Closed itas109 closed 4 years ago
Describe the bug read thread high CPU usage on linux(centos 7)
To Reproduce compile and run examples\CommNoGui\CSerialPortDemoNoGui run top or htop command
$ htop CPU[|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] Tasks: 40, 59 thr; 1 running PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command 12165 root 20 0 14980 2884 2684 R 99.1 0.1 0:26.62 ./CSerialPortDemoNoGui
Desktop (please complete the following information):
use sleep could solve high cpu usage problem. for(;;) is better than while(true)
for(;;)
while(true)
for(;;) { //do sth. usleep(1); }
Describe the bug read thread high CPU usage on linux(centos 7)
To Reproduce compile and run examples\CommNoGui\CSerialPortDemoNoGui run top or htop command
Desktop (please complete the following information):