[C++-sig] Re: boost::python and threads

David Abrahams dave at boost-consulting.com
Sun Jul 6 08:59:30 CEST 2003


Nikolay Mladenov <nickm at sitius.com> writes:

> David Abrahams wrote:
>> 
>> I don't believe that call policies can do what he wants yet, since
>> there's no provision for state to be carried across the precall() and
>> postcall() functions as required by Py_BEGIN_ALLOW_THREADS and
>> Py_END_ALLOW_THREADS.
>
> Yeah, ok. But this seems to be a bug, since the docs say 
> x is obbject of type P - model of CallPolicy:
> than 
> x.precall()
> ....
> x.postcall()

Yes; that is not a bug.

> and x should be able to carry the thread state.

Not if the wrapped function is re-entered.  The docs don't say
anything about when the policies object is created.  In fact each
wrapped function has a single instance of the policies object.

> The fact that most call policies are static and cannot chain this
> type of calls should probably be fixed?

Maybe so, but that's not enough to fix the problem.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list