Re: [Boost-bugs] [Boost C++ Libraries] #8414: flyweights causes weird library initialization error

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8414: flyweights causes weird library initialization error
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-08 18:05:20


#8414: flyweights causes weird library initialization error
-----------------------------------------------------------+----------------
  Reporter: charles quarra <charlls_quarra@…> | Owner: joaquin
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: flyweight
   Version: Boost 1.53.0 | Severity: Showstopper
Resolution: invalid | Keywords:
-----------------------------------------------------------+----------------

Comment (by joaquin):

 OK, we're getting somewhere :-)

 ''But it seems to me that this kind of static holder (variable instead of
 function local) is not shared across modules.''

 In reality, moving `c` from function-static to global-static has nothing
 to do with module sharing, but it breaks some promises the lib makes as
 for when the flyweight factory is initialized (technically, during the so-
 called ''dynamic initialization phase'' of the program startup sequence.)
 Anyway, if you're not declaring any flyweight-dependent static variable in
 your module, then you're safe.

 Now, about module sharing. As far as I know this does not make a
 difference (furthermore, given the symbol sharing capabilities of GCC you
 probably don't need anything like `intermodule_holder`.) But you can find
 out by yourself: just ''independently'' create two `SymbolName_t`s in
 different modules with the same content and check whether they're equal
 (which happens if they both point internally to the same value, hence
 sharing factory.) It is important that the two objects be created
 independently (that is, not one copied from the other) for the test to be
 valid.

 Good luck,

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8414#comment:8>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC