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 2022/04/14 08:31:27 UTC

[GitHub] [incubator-brpc] stdpain commented on issue #1741: bthread dead lock when yield with a lock

stdpain commented on issue #1741:
URL: https://github.com/apache/incubator-brpc/issues/1741#issuecomment-1098850059

   It looks like this, assuming there is only one worker.
   The worker schedules bthread1 to get the lock on the pthread and then performs a yield.
   The worker schedules bthread2 to try to get the pthread lock, and then blocks.
   
   Since worker is blocked, it cannot schedule bthread1, so bthread1 cannot release the lock, resulting in a deadlock.
   
   The main reason is not that the bthread_setconcurrency is too small. Because even if the worker is large, it will still get stuck, but the probability is very low.


-- 
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-unsubscribe@brpc.apache.org

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