Ailusa0106 commented on issue #1230:
URL: https://github.com/apache/incubator-brpc/issues/1230#issuecomment-688672893


   > > 值
   > 
   > butex/futex 的语义本身就不保证能看到最新值, 这里保证的都是"使用姿势正确"的前提下. 1) waiter 能看到最新的只。 or 2) 
waiter会被waker通过 *utex_wake() 唤醒.
   
   
嗯,多谢回复,主要是针对这个正确的姿势,拿bthread_mutex_unlock举例,假设两个thread,thread1解锁,此时锁变量的值去和0交换,交换之后利用butex_wake唤醒队列(但是此时队列为空),如果thread2
 wait_for_butex这个时候看不到最新值就会lock(append进入队列),但是已经没有thread能唤醒它了。


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