brpc icon indicating copy to clipboard operation
brpc copied to clipboard

support bthread primitive cross different worker pools

Open yanglimingcn opened this issue 1 year ago • 4 comments

What problem does this PR solve?

Issue Number:

Problem Summary:

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

yanglimingcn avatar Feb 28 '24 08:02 yanglimingcn

@wwbmmm 这个PR有一个点没有处理到 int TaskGroup::interrupt(bthread_t tid, TaskControl* c) 这个函数里面在sleep_id != 0,这部分,因为无法拿到tid原来的执行上下文信息,所以没有办法得到正确的tag分组。你看这块怎么处理合适呢?

yanglimingcn avatar Feb 29 '24 03:02 yanglimingcn

@wwbmmm 这个PR有一个点没有处理到 int TaskGroup::interrupt(bthread_t tid, TaskControl* c) 这个函数里面在sleep_id != 0,这部分,因为无法拿到tid原来的执行上下文信息,所以没有办法得到正确的tag分组。你看这块怎么处理合适呢?

修改了一下,给bthread_interrupt加了一个tag参数,代表用户希望在那个tag分组上执行。

yanglimingcn avatar Mar 02 '24 02:03 yanglimingcn

@wwbmmm 辛苦有时间review这个PR

yanglimingcn avatar Mar 07 '24 09:03 yanglimingcn

LGTM

wwbmmm avatar Mar 11 '24 02:03 wwbmmm

@yanglimingcn 请问这个PR是意味着可以跨tag使用bthread同步原语了吗? 使用中是否还有需要在注意的问题呢?

ketor avatar Apr 27 '24 15:04 ketor

@yanglimingcn 请问这个PR是意味着可以跨tag使用bthread同步原语了吗? 使用中是否还有需要在注意的问题呢?

是的,使用过程中没有什么要注意的,和原来的语义保持一致。

yanglimingcn avatar Apr 29 '24 02:04 yanglimingcn

@yanglimingcn 请问这个PR是意味着可以跨tag使用bthread同步原语了吗? 使用中是否还有需要在注意的问题呢?

是的,使用过程中没有什么要注意的,和原来的语义保持一致。

太赞了! 准备开始使用bthread worker pool的特性了。

ketor avatar May 03 '24 14:05 ketor

@yanglimingcn 请问这个PR是意味着可以跨tag使用bthread同步原语了吗? 使用中是否还有需要在注意的问题呢?

是的,使用过程中没有什么要注意的,和原来的语义保持一致。

太赞了! 准备开始使用bthread worker pool的特性了。

有问题可以随时沟通

yanglimingcn avatar May 03 '24 23:05 yanglimingcn