Boost logo

Boost :

Subject: Re: [boost] Gauging interest in a thread-safe containers library
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-01-14 09:43:19


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

On Tuesday 13 January 2009 18:34 pm, Eric Greveson wrote:
> * A thread-safe shared pointer provides a lazy but effective way of
> synchronising data in many scenarios (my implementation supports the
> usual boost::shared_ptr stuff except for get(), -> and *:
> dereferencing is provided by calling an acquire() function which
> returns a scoped_lock object on which you can call * and ->.

Why not support operator->()? It would be a convenience. Due to the way
operator->() works, all it has to do is return something like your
scoped_lock.

Also, I think it would be worthwhile to follow the concepts of
Boost.Threads/C++0x with respect to mutexes and locks. That is, make the
monitor fulfill the Lockable concept, and give your locks the interfaces of
boost::unique_lock, shared_lock, etc. except with added operator->() and
operator*().

> The
> destructor of the scoped_lock releases the lock.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFJbfoH5vihyNWuA4URAu9SAJsG6e3RUc+dsA1XpyCJAERZuEe1ygCfQZZk
hxMX+QWY35avYq2rA5Ts6sc=
=U37n
-----END PGP SIGNATURE-----


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk