[C++-sig] Re: Sharing Global Singleton instances across boost.python extensions (windows & unix)
Niall Douglas
s_sourceforge at nedprod.com
Sat Oct 11 02:53:27 CEST 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10 Oct 2003 at 19:56, David Abrahams wrote:
> > You need not worry about POSIX shared objects because these behave
> > more like a static library than DLL's do. But it is important not to
> > have anything depend on special DLL functionality eg; DllMain.
>
> Saying you need not worry is a bit too sanguine. POSIX shared objects
> have plenty of potential quirks, especially when it comes to dlopen'ed
> ones like most Python extension modules.
As do DLL's in Windows. If you've ever had the mispleasure of a DLL
faulting during initialisation, you'll know what I mean. Also, you
can't compare function pointers for equivalence if they're in a Win32
DLL etc. etc.
Thing is, if you're porting to and only to very recent versions of
Linux there are very few non-obvious quirks nowadays.
> >> First question: What is the best cross platform solution here?
> >
> > Do you have a GUI, and if so what are you using to operate it?
>
> I don't see how *that*'s relevant.
Because if he were using MFC or the Win32 API, then first off we need
to move to a cross-platform GUI toolkit - many of which provide
abstractions for dealing with DLL's and plenty more besides.
> > On Windows python is almost always a DLL.
>
> On Windows most of python is *always* a DLL which is linked to a tiny
> shell, the application.
I'm pretty sure it can be compiled as a static library on Win32, but
you're the expert.
> > On Linux the default is a static library to my knowledge.
>
> On Linux the default for extending is that it's an executable and the
> symbols get seen by extension modules. For embedding, yes the default
> is a static library.
Don't suppose you know why this is Dave? I only found this out last
night and was quite puzzled by it not using a .so.
Cheers,
Niall
-----BEGIN PGP SIGNATURE-----
Version: idw's PGP-Frontend 4.9.6.1 / 9-2003 + PGP 8.0.2
iQA/AwUBP4dUh8EcvDLFGKbPEQLytwCfUauz4jApa3yd1VuNay62XFSAeH8AnRHr
G7Nh4byCIz5nrRp8JVXcz5Z4
=rlpq
-----END PGP SIGNATURE-----
More information about the Cplusplus-sig
mailing list