Boost logo

Boost :

Subject: [boost] [flyweight][#3658] Dependency on static initialization/destruction order
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2009-11-28 08:22:16


Hi,

I've created the ticket #3658 [1] on the flyweights library. The ticket
is about Boost.Flyweight depending on the static
initialization/destruction order, which can lead to application crashes
in some cases.

The library does provide certain tools to work around the problem [2],
but these tools are only usable in the most obvious cases and do not
solve the problem in its root.

What I have proposed in the ticket is to implement reference counting in
the flyweights, so that the flyweight value is only destroyed when no
flyweight handles refer to it. AFAIK, Boost.Flyweight already has
reference counting, so the work is only to shift value owning from the
holder to the flyweights.

Comments are welcome.

[1] https://svn.boost.org/trac/boost/ticket/3658
[2]
http://www.boost.org/libs/flyweight/doc/tutorial/technical.html#static_init


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