Nice! A little bit of cleaning up and editing and that worked like a charm,
thanks
Here is what I had to do:
struct timer_func_wrapper_t
{
timer_func_wrapper_t( bp::object callable ) : _callable( callable ) {}
bool operator()()
{
PyGILState_STATE gstate = PyGILState_Ensure();
On Mon, Feb 1, 2010 at 5:22 PM, Charles Solar wrote:
> I have a method that takes a boost function object as so
>
> bool createTimer( boost::int64_t interval, boost::function< bool() >
> function, bool recurring = false )
>
> that I would like to call in python. I tried exporting the class in Py+
> I'm not convinced of this. It is true that there may only ever be one thread
> accessing the Python runtime (thus the GIL to enforce it). But you may
> certainly have as many threads doing other work as you want. And if your
> OpenMP-enabled code is pure C++, with no hooks into the Python runtime
On 02/01/2010 12:58 PM, Anders Wallin wrote:
How difficult is it to make boost-python play nice with OpenMP? Anyone
done it? Is this ever going to be a feature of boost-python, or always
going to require special patching and hacking?
I'm not sure in how much boost.python would actually n
>> How difficult is it to make boost-python play nice with OpenMP? Anyone
>> done it? Is this ever going to be a feature of boost-python, or always
>> going to require special patching and hacking?
> I'm not sure in how much boost.python would actually need to care about
> this. Presumably, some Op
Anders Wallin wrote:
Hello group,
I have C++ code which uses OpenMP to parallellize some algorithms.
When wrapped with boost-python only one thread seems to run at a time,
and there is no speedup (as seen with pure C++) when using multiple
core machines.
The FAQ says this is pretty much expected
On 02/01/2010 12:07 PM, Anders Wallin wrote:
Hello group,
I have C++ code which uses OpenMP to parallellize some algorithms.
When wrapped with boost-python only one thread seems to run at a time,
and there is no speedup (as seen with pure C++) when using multiple
core machines.
The FAQ says this
Hello group,
I have C++ code which uses OpenMP to parallellize some algorithms.
When wrapped with boost-python only one thread seems to run at a time,
and there is no speedup (as seen with pure C++) when using multiple
core machines.
The FAQ says this is pretty much expected, but hints at a possib
I have a method that takes a boost function object as so
bool createTimer( boost::int64_t interval, boost::function< bool() >
function, bool recurring = false )
that I would like to call in python. I tried exporting the class in Py++
but it did not look like it does anything special with that ar