t;>> thread_locker()
>>> {
>>> if (thread_support::enabled())
>>> m_gstate = PyGILState_Ensure();
>>> }
>>>
>>> ~thread_locker()
>>> {
>>> if (thread_support::enabled())
>>> PyGILState_Release(m_gstate);
>>> }
>> }
>>>
>>> ~thread_locker()
>>> {
>>> if (thread_support::enabled())
>>> PyGILState_Release(m_gstate);
>>> }
>>> };
>>>
>>> then in my wrapper virtual implementation I did this:
>>>
>>> ...
>
iam Ladwig wrote:
>>> Whoops, I think this problem is a little uglier than I thought, since
>>> you
>>> overrode the onTick() function in python with a call to print, which
>>> needs access to the interpreter in your new thread. See the link Thomas
>>> p
illiam Ladwig wrote:
>>> Whoops, I think this problem is a little uglier than I thought, since you
>>> overrode the onTick() function in python with a call to print, which
>>> needs access to the interpreter in your new thread. See the link Thomas
>>> posted f
rying about any possible
>> garbage collection issues). Now I remember why I kept my C++ threads
>> isolated from Python stuffsorry, it's been a while
>>
>> Bill
>> ____________________
>> From: cplusplus-sig-bounces+wladwig=wdtin
bounces+wladwig=wdtinc@python.org
> [cplusplus-sig-bounces+wladwig=wdtinc@python.org] On Behalf Of William
> Ladwig [wlad...@wdtinc.com]
> Sent: Saturday, July 04, 2009 1:34 PM
> To: Development of Python/C++ integration
> Subject: Re: [C++-sig] boost::python and threads
>
>
adwig=wdtinc@python.org] On Behalf Of William
> Ladwig [wlad...@wdtinc.com]
> Sent: Saturday, July 04, 2009 1:34 PM
> To: Development of Python/C++ integration
> Subject: Re: [C++-sig] boost::python and threads
>
> It looks to me like you have a garbage collection problem go
lf Of William
Ladwig [wlad...@wdtinc.com]
Sent: Saturday, July 04, 2009 1:34 PM
To: Development of Python/C++ integration
Subject: Re: [C++-sig] boost::python and threads
It looks to me like you have a garbage collection problem going on. If you
create a wrapped c++ object in python, then pyth
It looks to me like you have a garbage collection problem going on. If you
create a wrapped c++ object in python, then python is going to own the object
and will destroy it when its reference count goes to 0. In your python example
script at the bottom, you call the Ticker's run() function, wh
Hi,
On Fri, Jul 3, 2009 at 1:15 PM, Paul Scruby wrote:
> I am having some problems using boost::python with boost::thread. I'm using
> threads because I want to run some tasks in the background when I'm using
> the Python's interactive shell. However, when I use get_override() to call
> a Python
10 matches
Mail list logo