Mr Kun Hong wrote:

The lines in the documentation is:

'''
It might be appropriate to use the static Boost.Python library in any of the 
following cases:

*  You are extending python and the types exposed in your dynamically-loaded 
extension module
     don't need to be used by any other Boost.Python extension modules, and you 
don't care if the
     core library code is duplicated among them.
> ...
'''

I guess
what the problem is should be that: another python extension, written in boost 
python,
cannot access the types and functions exposed in my current extension. I am not
clear why is it so, becaused it is exposed to the python interpreter already. 
If there are
two python extensions, both written in pure C, can't they access each other's 
type and
functions?

Suppose you develop two different Python extensions, each statically linked with Boost.Python. The situation looks like this:

            Ext1 | Boost.Python
           /
Python
interpreter
           \
            Ext2 | Boost.Python

You have two different copies of Boost.Python in memory at the same time. Presumably Boost.Python contains certain static data used to manage registering types to the Python interpreter. I guess the documentation is saying that if Ext2 tries to reference types defined in Ext1, it might confuse Boost.Python's static data.

Contrast with dynamic linking:

            Ext1
           /    \
Python           Boost.Python
interpreter      /
           \    /
            Ext2

Having a single copy of the Boost.Python static data eliminates the potential for confusion.
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to