wwbmmm commented on issue #1859:
URL: 
https://github.com/apache/incubator-brpc/issues/1859#issuecomment-1201083002

   The work stealing in libgo is implemented by a global scheduler:
   
https://github.com/yyzybb537/libgo/blob/master/libgo/scheduler/scheduler.cpp#L340
   It runs work stealing at an interval of 1000us by default. 
   When a task is ready to run but current worker is busy, it needs at most 
1000us to be stolen by an idle worker.
   
   In bthread, when a task is ready to run, futex_wake is called to wakeup an 
idle worker at once. This avoids long-tail latency. But the cost is that most 
task switch needs futex. It needs about 2us from one thread calls futex_wake 
and another thread resumes from futex_wait.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to