[Pyrex] Global

Michael P. Dubner pywebmail at list.ru
Mon Jun 28 01:02:10 CEST 2004


Phillip J. Eby wrote:

> At 01:23 AM 6/27/04 +0200, Mateusz Korniak wrote:
>
>> I wonder if it is possible and good idea to safely release GIL while 
>> one of
>> threads comes to C++ section to gain better performance ?
>
>
> Only if the C++ does not make *any* Python API calls.

Esuring which in Pyrex is lot of trouble.
Deadly incomplete list of rules:
1. Don't use variable declared as object (or undeclared)
2. Don't use objects declared as specific python object (extention class)
3. Don't use python functions (declared using def)
3. Don't use functions that gives of returns python objects (see no 1 & 2)
4. Don't use functions that declared (using except *|NULL|...) to be 
able to raise Python extention (ever if you now it will not your 
generated code will check for it - using python call)
5. Don't use try/except or try/finally clause (is it true about finally? 
nevertheless you shouldn't need this due to no 4)
6. What I forget to mention?

--
Best regards,
Michael Dubner (dubnerm at mindless.com)
Brainbench MVP/HTML+JavaScript (http://www.brainbench.com)
PS: Sorry for my English





More information about the Pyrex mailing list