Re: [C++-sig] Managing the GIL across competing threads

2012-03-15 Thread Adam Preble
I edited the post so many times I forgot the subject line! I am a bad person. Maybe the most condensed question here is: How do you normally manage multiple resources competing with the GIL in a way that could cause deadlocks with it? For the details, see the long post. On Thu, Mar 15, 2012 at

[C++-sig] (no subject)

2012-03-15 Thread Adam Preble
I discovered recently that during callbacks to Python objects, sometimes the interpreter would try to do stuff at the same time, despite the fact I made a call to ensure the GIL. I read the solution for that kind of thing I'm doing is calling PyEval_InitThreads(). This worked at first, but like m

[C++-sig] Re : [boost] Re : Using an element of a class A in a constructor of a class B (reflection with boost::python)

2012-03-15 Thread christophe jean-joseph
Hello The situation is as follow. I have a C++ code that I haven't written and that I barely can modified. I am supposed to reflect this code in Python with boost. In the code, I have something looking like this: Class A_Base {   A_Base(){};   ~A_Base(){};   Whatever virtual and pure virtual fu

Re: [C++-sig] Combining Boost Serialization with Boost Python

2012-03-15 Thread Neal Becker
I have used this myself for some time. Here is an example: typedef boost::mt19937 rng_t; struct mt_pickle_suite : bp::pickle_suite { static bp::object getstate (const rng_t& rng) { std::ostringstream os; boost::archive::binary_oarchive oa(os); oa << rng; return bp::str (os.