Boost logo

Boost :

From: Tim Blechmann (tim_at_[hidden])
Date: 2008-01-21 16:31:53


hi all,

> The formal review of Flyweight library, proposed by Joaquín M. López
> Muñoz, begins today (sorry for the late announcement):

<snip>

> * What is your evaluation of the design?

the flyweight class works quite similar to a class, that i am using in
one of my c++ projects. from my point of view, the library is designed
very well, there is only one issue, that i would like to see handled
differently.
the flyweight factory is a shared container, that can be configured to
use one of the locking policies 'no_locking' and 'simple_locking'.
simple_locking would guard the constructor/destructor by a mutually
exclusive lock. while this is certainly correct, it is not actually
necessary. the factory container needs only be locked exclusively by one
thread, when the container is manipulated.

instead of this 'simple_locking' policy, i would propose to guard the
factory container by a reader-writer lock. if one object is used more
than once, the ctors/dtors only need to acquire a reader lock for the
container, only if new objects are inserted, a writer lock is required.

this policy would make the library more scalable for multi-threaded
applications ... i am not sure about the 'boost way' of implementing
this, but afair a reader-writer lock was about to be added to
boost.thread. this library would be the perfect use case for it ...

> * What is your evaluation of the implementation?

i had only a brief look at the implementation ... looked fine for me ...

> * What is your evaluation of the documentation?

looked good to me ...

> * What is your evaluation of the potential usefulness of the library?

the library should be quite useful ... hopefully reduce the memory
footprint of some applications ...

> * Did you try to use the library? With what compiler?
> Did you have any problems?

no

> * How much effort did you put into your evaluation?
> A glance? A quick reading? In-depth study?

i was reading about the concept and compared it with my
implementation ...

> * Are you knowledgeable about the problem domain?

i have my own implementation of the same concept ...

> And finally, every review should answer this question:
>
> * Do you think the library should be accepted as a Boost library?
> Be sure to say this explicitly so that your other comments
> don't obscure your overall opinion.

yes

cheers, tim

--
tim_at_[hidden]
http://tim.klingt.org
The price an artist pays for doing what he wants is that he has to do
it.
  William S. Burroughs



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