rpbear88 opened a new issue #1443:
URL: https://github.com/apache/incubator-brpc/issues/1443


   hi all,在`TaskGroup::sched_to`的代码中有这么一句注释:
   
   ```
   if (next_meta->stack != cur_meta->stack) {
       jump_stack(cur_meta->stack, next_meta->stack);
       // probably went to another group, need to assign g again.
       g = tls_task_group;
   }
   ```
   
   我比较好奇产生这个的原因,按我理解是不是因为某个bthread的栈可能是分配在另一个pthread中(使用其main stack)的,但是由于work 
stealing,该task被本worker得到,那么jump stack会回到最初的pthread worker中?所以以下两种情况下,work 
stealing作用不大:
   1. 用户选择的栈模式是BTHREAD_STACKTYPE_PTHREAD
   2. 分配栈空间时OOM了
   
   但是还是感觉不太对的是,如果只是切个用户态的栈,好像也不会切换pthread吧?到底是什么原因还请解释下。
   
   @jamesge @chenzhangyi 


-- 
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.

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