admin管理员组文章数量:1315347
On LWN, the URCU library is said to require all reading threads to (un-)register themselves, as well as indicate their quiescent state, in order to make use of QSBR.
However, each thread must periodically invoke rcu_quiescent_state(), just as in the kernel, where schedule() must be invoked periodically. Each thread that is to execute RCU read-side critical sections must also invoke rcu_register_thread() after thread creation and rcu_unregister_thread() before thread exit.
or later
QSBR provides the highest performance, but requires that all reader threads periodically indicate quiescent states via either rcu_quiescent_state() for a momentary quiescent state or using rcu_thread_offline()/rcu_thread_online() pairs for extended quiescent states
On the same page, the table reads, that it's generally not OK to use QSBR for RCU in library code.
Given, that a library knows, that it has to (un-)register it's thread, when it has to indicate it's quiescent state and when it's a reader thread, I fail to understand how this is relevant.
After all, any application would never access library data directly but only through the library interface.
And even if it did, it should be possible to provide wrappers to the user, that have to be called from application code, or am I missing something?
p. 807 in Chapter E.9. of Perfbook, claims that "each and every thread" needs to indicate their quiescent state. This would make more sense. But if a thread is neither a reader nor a writer thread, isn't it automatically in quiescent state?
本文标签: multithreadingWhy is QSBR unsuitable for use in librariesStack Overflow
版权声明:本文标题:multithreading - Why is QSBR unsuitable for use in libraries? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741976367a2408148.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论