jiangdongzi commented on issue #1447: URL: https://github.com/apache/incubator-brpc/issues/1447#issuecomment-1076329146
> Hi @rpbear88 , 如文档所述,bthread创建是比较快的,主要耗时确实是在调度延迟。任务创建后直至被运行也有几个步骤,首先会在当前worker的rq中排队,若其他worker空闲,则会进行work stealing;其他worker可能之前处于挂起睡眠状态,work stealing之前还需要执行唤醒。而work stealing中可能会对多个TaskGroup进行尝试,极端负载下如果尝试多次也会造成很大的overhead,每次work stealing会先偷取某线程的rq,会有原子操作开销,之后会尝试remote_rq会有锁的开销,stealing之后由于cache locality不佳,也会有性能的损失。整体链路延迟可能会有几微秒到几十微秒不等 hi, pthread调度开销也时几微秒, 为什么不直接使用pthread线程池呢 -- 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]
