ZhengweiZhu commented on issue #2983:
URL: https://github.com/apache/brpc/issues/2983#issuecomment-3388115548

   
   
   > Under the protection of version_lock, there should be only one waiter.
   > 
   > Jumping precedes tracing, From the bthread's perspective: traced = false; 
From the tracer's perspective: status = TASK_STATUS_JUMPING; Only the tracer is 
waiting.
   > 
   > Tracing precedes jumping, From the bthread's perspective: traced = true; 
From the tracer's perspective: status != TASK_STATUS_JUMPING; Only the bthread 
is waiting.
   > 
   > Perhaps the traced or status values ​​are incorrect?
   
   Jumping precedes tracing,  from the tracer's perspective the current 
implementation set m->traced = true first, then find its status 
TASK_STATUS_JUMPING and block at WaitForJumping(m). When the bthread is about 
to jumping to run, it finds it is traced so block at WaitForTracing(m), causing 
deadlock. Just check the first pic in my last comment.  
   
   Perhaps the tracer should not set bthread traced to true when finds its 
status is TASK_STATUS_JUMPING?
   
   


-- 
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: [email protected]

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