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/08/08 01:39:57 UTC

[GitHub] [incubator-brpc] ruoshui1314 opened a new issue #1201: 请教下为什么SamplerCollector::run中的链表不需要全局加锁呢

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


   你好,我认真看了采样的代码,有一个地方的疑问没有解开,各位大佬能否帮忙解答下。
   
   在采样的代码中添加到队列是Sampler::schedule() 添加调用CombineSampler然后加入链表。但是删除的时候在SamplerCollector::run 中 RemoveFromList 为啥不需要加锁操作呢?这看不出来是lock_free的链表呀。感觉添加节点和删除节点从代码逻辑上是无关的?这是怎么做到的
   如果是这样删除节点的时候干吗还需要用used这个变量,而不是直接removefromlist呢?
   


----------------------------------------------------------------
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] ruoshui1314 closed issue #1201: 请教下为什么SamplerCollector::run中的链表不需要全局加锁呢

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


   


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