chenBright commented on issue #2833: URL: https://github.com/apache/brpc/issues/2833#issuecomment-2546141325
之前在#1822 讨论过这个需求,看起来自定义callback不太满足这个需求: 1. 用户能知道第一次调度,但是不知道最后一次调度。 2. 用户需要熟悉bthread内部调度原理才能用好callback。 自定义callback结合#2851 中的bthread状态,应该会好用些。 https://github.com/apache/brpc/issues/1822#issuecomment-1202082072 > 考虑扩展一下bthread::TaskStatistics,加个cpu消耗的统计项,并且在bthread切换时更新该值。 我认为这个方案更合适。clock_gettime是系统调用,会影响bthread调度性能,所以在此方案的基础上补充两点: 1. 在bthread_attrflags_t加个开关,默认不统计纯cpu消耗。用户有需要可以通过bthread_attrflags_t启用该功能。 2. server bthread是由框架创建的,用户没法干预。在ServerOptions加上开关来启用该功能。 @wwbmmm 有什么建议吗? -- 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: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org