You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/09/21 01:59:21 UTC

[GitHub] [incubator-brpc] brokensword2018 opened a new issue #1249: 关于is_current_pthread_task 这个函数的疑问

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


   Dear all.   
   ```cpp 
   // True iff current task is the one running run_main_task()
       bool is_current_main_task() const { return current_tid() == _main_tid; }
       // True iff current task is in pthread-mode.
       bool is_current_pthread_task() const
       { return _cur_meta->stack == _main_stack; }
   ```
   每个worker线程应该都是执行,run_main_task. current_tid() == _main_tid 不是和 _cur_meta->stack == _main_stack等效的吗? True iff current task is in pthread-mode这句话不是很理解。


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] brokensword2018 removed a comment on issue #1249: 关于is_current_pthread_task 这个函数的疑问

Posted by GitBox <gi...@apache.org>.
brokensword2018 removed a comment on issue #1249:
URL: https://github.com/apache/incubator-brpc/issues/1249#issuecomment-696740413


   > 两个条件不等价, _cur_meta->stack == _main_stack 成立的时候,current_tid() == _main_tid 不一定成立。有些情况下bthread会复用main task 的堆栈,可以读一下ending_sched这个函数的源码理解一下
   
   非常感谢


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] brokensword2018 commented on issue #1249: 关于is_current_pthread_task 这个函数的疑问

Posted by GitBox <gi...@apache.org>.
brokensword2018 commented on issue #1249:
URL: https://github.com/apache/incubator-brpc/issues/1249#issuecomment-696740413


   > 两个条件不等价, _cur_meta->stack == _main_stack 成立的时候,current_tid() == _main_tid 不一定成立。有些情况下bthread会复用main task 的堆栈,可以读一下ending_sched这个函数的源码理解一下
   
   非常感谢


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] brokensword2018 commented on issue #1249: 关于is_current_pthread_task 这个函数的疑问

Posted by GitBox <gi...@apache.org>.
brokensword2018 commented on issue #1249:
URL: https://github.com/apache/incubator-brpc/issues/1249#issuecomment-696740413






----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] brokensword2018 commented on issue #1249: 关于is_current_pthread_task 这个函数的疑问

Posted by GitBox <gi...@apache.org>.
brokensword2018 commented on issue #1249:
URL: https://github.com/apache/incubator-brpc/issues/1249#issuecomment-696743267


   > 两个条件不等价, _cur_meta->stack == _main_stack 成立的时候,current_tid() == _main_tid 不一定成立。有些情况下bthread会复用main task 的堆栈,可以读一下ending_sched这个函数的源码理解一下
   
   非常感谢


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] gydong commented on issue #1249: 关于is_current_pthread_task 这个函数的疑问

Posted by GitBox <gi...@apache.org>.
gydong commented on issue #1249:
URL: https://github.com/apache/incubator-brpc/issues/1249#issuecomment-696561662


   两个条件不等价, _cur_meta->stack == _main_stack 成立的时候,current_tid() == _main_tid 不一定成立。有些情况下bthread会复用main task 的堆栈,可以读一下ending_sched这个函数的源码理解一下


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] gydong commented on issue #1249: 关于is_current_pthread_task 这个函数的疑问

Posted by GitBox <gi...@apache.org>.
gydong commented on issue #1249:
URL: https://github.com/apache/incubator-brpc/issues/1249#issuecomment-696561662


   两个条件不等价, _cur_meta->stack == _main_stack 成立的时候,current_tid() == _main_tid 不一定成立。有些情况下bthread会复用main task 的堆栈,可以读一下ending_sched这个函数的源码理解一下


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] brokensword2018 closed issue #1249: 关于is_current_pthread_task 这个函数的疑问

Posted by GitBox <gi...@apache.org>.
brokensword2018 closed issue #1249:
URL: https://github.com/apache/incubator-brpc/issues/1249


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] brokensword2018 removed a comment on issue #1249: 关于is_current_pthread_task 这个函数的疑问

Posted by GitBox <gi...@apache.org>.
brokensword2018 removed a comment on issue #1249:
URL: https://github.com/apache/incubator-brpc/issues/1249#issuecomment-696740413


   > 两个条件不等价, _cur_meta->stack == _main_stack 成立的时候,current_tid() == _main_tid 不一定成立。有些情况下bthread会复用main task 的堆栈,可以读一下ending_sched这个函数的源码理解一下
   
   非常感谢


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] brokensword2018 closed issue #1249: 关于is_current_pthread_task 这个函数的疑问

Posted by GitBox <gi...@apache.org>.
brokensword2018 closed issue #1249:
URL: https://github.com/apache/incubator-brpc/issues/1249


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org