As known std::shared_timed_mutex
(C++14) and std::shared_mutex
(C++17) has a performance advantage over std::mutex
only for a very long std::shared_lock
s (reads-operations), and when std::shared_lock
s more than std::unique_lock
s.
But even if most of its are read operations, and they are short, then std::mutex
will be faster - that is why in the C++11 standard std::shared_mutex
and std::shared_timed_mutex
were not included immediately.
Is there any approach or implementation of some kind of shared mutex, which has a performance advantage over std::mutex
, also for a short operations, if the reads are not just more, and a lot more as below?
std::unique_lock
/ std::shared_lock
= 1 / 1 000 000 000 000
Is there any approach of shared mutex for a short shared-operations and few unique operations?
Aucun commentaire:
Enregistrer un commentaire