为什么 C++0x 标准委员会拒绝 boost::shared_mutex? [英] why C++0x standard committee rejected boost::shared_mutex?
问题描述
你有关于这个主题的任何信息吗?特别是 boost::shared_mutex 和读写器互斥体有什么问题吗?
do you have any info about the subject? any problem with boost::shared_mutex in particular and with reader-writer mutexes at all?
读写器互斥锁可能会被滥用,例如频繁的写锁会降低性能,即使与简单的互斥锁相比也是如此.但在很多情况下,许多读者经常需要一个共享资源,而作者很少修改.
reader-writer mutex can be misused, e.g. frequent writer locks reduces performance, even in comparison with simple mutex. but there're a lot of cases when many readers often require a shared resource that can be modified by writer really infrequently.
推荐答案
Anthony Williams 是 C++ 标准委员会的一位有影响力的成员.他与人合着了许多导致将线程库包含在 C++11 标准中的提案.您可以在这篇评论中阅读他的反对意见.尽管如此,它确实进入了 C++17.
Anthony Williams is an influential member of the C++ standards committee. He co-authored many of the proposals that led to the inclusion of the thread library in the C++11 Standard. You can read his objections in this commentary. Nevertheless, it did make it into C++17.
这篇关于为什么 C++0x 标准委员会拒绝 boost::shared_mutex?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!