Boost logo

Boost :

From: Pavel Antokolsky aka Zigmar (zigmar_at_[hidden])
Date: 2005-05-09 00:34:31


On 5/8/05, Terence Wilson <tez_at_[hidden]> wrote:
> __declspec(dllexport)/__declspec(dllimport) needs to be specified in order
> that the variable can be exported from the DLL it is defined in and imported
> in client DLL's & EXE's. This will give you a per-process singleton, if you
> want a singleton instance shared by *all* clients of the DLL of which it is
> defined use #pragma data_seg(".SHARED").
Thanks. I already familiar with windows dlls (unfortunately?). I've
made all those things you have mentioned (besides "shared") (I can
sent you a source code, if you are interested). The problem is, that
the Singleton library is header-only library, and stores singleton
manager(s) in static function variable(s). And when those code inlined
into several different dlls,it results independent static variables
in different modules (although is same code), which, in its turn,
results multiple singleton instances.

-- 
Best regards,
Zigmar

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