[C++-sig] X-language polymorphism and multithreading

Hans Meine hans_meine at gmx.net
Wed Jul 7 09:44:17 CEST 2010


On Tuesday 06 July 2010 21:30:25 Anton Yabchinskiy wrote:
> On 2010-07-03 05:03:53+0400, Anton Yabchinskiy wrote:
> > So, I need PyGILState_Ensure/PyGILState_Release around the
> > overridden method call, and PyEval_InitThreads in the module
> > initialization. Am I right? Is the following code OK?
> 
> With the GIL stuff code runs nicely now. It used to hang in the
> callback, but that was my fault: I forgot to export one of the types
> properly. I've just asked to be sure that I'm getting it
> right. Charles, Hans, thanks for the valuable information.

Remember that you probably need the GIL earlier than in the code you posted, 
namely for the get_override().  "runs nicely" can mean "most of the time" with 
threading, you know... ;-)

HTH,
  Hans


More information about the Cplusplus-sig mailing list