You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
void _st_vp_check_clock(void)
{
......
now = st_utime();
elapsed = now - _ST_LAST_CLOCK;
_ST_LAST_CLOCK = now;
while (_ST_SLEEPQ != NULL) {
thread = _ST_SLEEPQ;
ST_ASSERT(thread->flags & _ST_FL_ON_SLEEPQ);
if (thread->due > now)
break;
_ST_DEL_SLEEPQ(thread);
......
/* Make thread runnable */
ST_ASSERT(!(thread->flags & _ST_FL_IDLE_THREAD));
thread->state = _ST_ST_RUNNABLE;
_ST_ADD_RUNQ(thread);
What happends when there is a lot of timer, so that the 0us<timeout<1ms? The _st_epoll_dispatch consumes lots of CPUs, because epoll_wait(0ms) while the timer does not run(>0us).
The resolution for
epoll_wait
is ms, while thest_usleep
is us.What happends when there is a lot of timer, so that the
0us<timeout<1ms
? The_st_epoll_dispatch
consumes lots of CPUs, becauseepoll_wait(0ms)
while the timer does not run(>0us).当系统有非常多的timer时,会出现
0us<timeout<1ms
的情况,这时候epoll会立刻返回epoll_wait(0ms)
,但是timer并不会执行(>0us)还没有到准确的唤醒时间。The text was updated successfully, but these errors were encountered: