From this question I understand that std::scoped_lock is "a strictly superior version of std::lock_guard".
From this question I understand that "std::lock_guard and std::unique_lock are the same" except that std::unique_lock has some extra features (eg. try_lock) at the cost of some additional overhead.
How does std::scoped_lock compare with std::unique_lock?
Some related questions that I am hoping to get answered by this question.
- What are the differences between
std::scoped_lockandstd::unique_lock? - In what situations should you use
std::scoped_lockinstead ofstd::unique_lock? - In what situations should you use
std::unique_lockinstead ofstd::scoped_lock? - Why does
std::scoped_locknot implement some of the additional features ofstd::unique_lock?
Aucun commentaire:
Enregistrer un commentaire