Boost logo

Boost Users :

Subject: Re: [Boost-users] question about threading library
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-11-06 15:53:26


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 06 November 2008 14:44 pm, Robert Ramey wrote:
> I want to use the boost threading library in an application.
>
> Looking through the documentation, I have a questions.
>
> a) in the examples I find "boost::mutex::scoped_lock" but
> I don't find this in the documentation. It looks like this
> is called "lock_guard". What should I be doing here.

I believe the mutex::scoped_lock, etc. are only there for backward
compatibility with the older Boost.Thread API.

> b) Its not clear to me how unique_lock(Lockable l)
> is different than using lock_gard(..) or scoped_lock.

unique_lock is just more featureful/complex than lock_guard. You can't do
a "try lock" or "timed lock" with a lock_guard, for example. Personally, I
just use unique_lock.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFJE1lH5vihyNWuA4URAiGvAJ9ksLtJCobAJjy9SazzVi0/NQemvwCffrmX
DH0IdB3Qy6LY4LXJ0FwWNsg=
=b+Te
-----END PGP SIGNATURE-----


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net