yanglimingcn commented on PR #2492: URL: https://github.com/apache/brpc/pull/2492#issuecomment-2296167038
你实现的这个无锁队列,理论上性能很好的,不希望这个唤醒影响到性能。 我这边有这个唤醒需求的话,我根据自己的场景去实现,应该只需要一个原子变量就可以了,具体描述: 1、消费者消费队列的内容,直到返回false,在持续返回false一段时间,就会设置一个flag为,need_wakeup_flag。 2、生产者在往队列放内容的后,会根据need_wakeup_flag执行一次唤醒。 因为这个need_wakeup_flag不会被频繁设置,因此,这个原子变量的更新预期不会很频繁。 -- 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-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org