ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> c++-sig
c++-sig
Re: [C++-sig] Re: Boost.Python and threads
by Niall Douglas other posts by this author
Oct 3 2003 11:22PM messages near this date
Re: [C++-sig] Re: Boost.Python and threads | [C++-sig] Re: Returning reference to member variable that's a basic type
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3 Oct 2003 at 18:28, David Abrahams wrote:

>  > I've followed the thread about boost.python multithreading between
>  > Lijun Qin and David Abrahams and I wondered where was the
>  > implementation of this ? If there is no implementation, what is the
>  > best way to safely unblock the python threads ? Or at least where
>  > can I find information about this ?
>  
>  Sorry it took so long to reply Pierre; I was really hoping someone
>  else (like Lijun) would answer.
>  
>  Anyway, I don't have an implementation of multithreading support, at
>  least not yet.
>  
>  THe best way to safely unblock threads that I know of is to write a
>  thin wrapper around your function which uses Py_BEGIN_ALLOW_THREADS
>  and Py_END_ALLOW_THREADS around a call to the real function.

What did you think of my idea for a macro (say 
"BOOST_PYTHON_ALWAYS_UNLOCK_GIL") which compiles it unlocking and 
relocking around every traversal from BP into C++ code?

Inefficient, but changing a mutex is nothing when compared to 
executing a single python byteop.

Cheers,
Niall





-----BEGIN PGP SIGNATURE-----
Version: idw's PGP-Frontend 4.9.6.1 / 9-2003 + PGP 8.0.2

iQA/AwUBP34EnMEcvDLFGKbPEQLQzwCfbBKC3LtfNiZIv9zMGqzS5kSIPUsAoPSX
OMTz2Lnlv4OKRqye5cLRDeoZ
=P2Rk
-----END PGP SIGNATURE-----

_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
Pierre Barbier de Reuille
Lijun Qin
David Abrahams
Pierre Barbier de Reuille
Niall Douglas
David Abrahams
Joel Gerard
Joel Gerard

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved