[C++-sig] [patch] Make boost python accessible by multiple threads

Niall Douglas s_sourceforge at nedprod.com
Sat Jul 17 16:18:29 CEST 2010


On 16 Jul 2010 at 13:38, Charles Solar wrote:

> I mentioned it before but I have this patch for boost python that adds
> code to lock and unlock the gil at all the boundaries I have found
> between python and boost python.  This makes it so multiple threads
> can call into python without the user having to lock and unlock the
> gil themselves.  I am pretty sure this is a very much desired feature
> but I guess the developers are waiting for a head start, so here is
> the patch file that can be applied to the boost trunk or any of the
> 1.4x versions of boost python.  I would very much like to see the
> patch correctly worked into boost python so I no longer have to
> maintain it myself.

Thanks for posting this patch. I promised someone on here some months 
ago I'd do a proper version of this patch based on static upcalls 
thinking that the then upcoming MSVC10 had support for variadic 
templates. Unfortunately, it doesn't and hence I have found it all 
too easy to make excuses to leave it till later until when it does.

> I have been using this in my application for a few months now and I am
> fairly confident in its completeness when NOT embedding python
> interpreters.  There may be more entry points I have missed because I
> do not embed python in my app, therefore I would say this patch is
> only non-embedded systems.

I see that you based your patch on my original patch. My original 
patch DID support embedding, but there was a lot of TnFOX-specific 
stuff in there to achieve it. If I remember rightly, it was a bit of 
a hornet's nest :)

Cheers,
Niall
-- 
Technology & Consulting Services - ned Productions Limited.
http://www.nedproductions.biz/. VAT reg: IE 9708311Q. Company no: 
472909.





More information about the Cplusplus-sig mailing list