c++ - About boost::lock_guard and boost::unique_lock -


i hoping tell me if understanding on following 3 locks correct , possibly add it. main concern speed minimum overhead.

  • boost::lock_guard
  • boost::unique_lock
  • boost::scoped_lock

boost::lock_guard lightest kind of lock , shared amongst members of process. unique_lock improved version of lock_guard more functionality. scoped_lock allows locking across different processes.the scoped_lock heaviest of locks.is understanding correct. thread here states scoped_lock similar unique_lock. if mean scoped_lock heavy unique_lock ?

if mean heavy amount of overhead, yes scoped_lock heavy unique_lock, because they're same thing. according this, unique lock has few more features lock_guard, @ expense of bit of overhead.


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -