Turn on the SIP command-line flag that will generate code around every wrapped C++ call to release and reacquire the GIL. After some testing this seems to be the best option and the additional overhead is mostly negligible.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70983 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-03-23 03:19:56 +00:00
parent 16109cd7bc
commit 1f9c6d88b0
2 changed files with 2 additions and 32 deletions

View File

@@ -58,36 +58,6 @@ Checklist for all new etg files
Handling the GIL
----------------
Currenlty nothing is set for how to deal with the GIL, so there is no
release and reaquire happening yet, meaning that threads will be
blocked while control is in the C++ code. There are some
possibilities to be considered.
* Classic wxPython would wrap **every** call to a C++ function in
GIL release/reaquire code. Later on I added the ability to not
do that for specific classes or methods (those known to not
block, take a "long" time, or that could result in a callback.)
This likely missed many places that could have benefitted from
not dealing with the GIL. Should the same approach be taken
with Phoenix? Or should the default be to not release/aquire
the GIL and we'll have to turn it on for classes or functions
that need it? If so we could automatically turn it on for
Window classes and that would probably take care of most of the
places that must have it.
* Take a look at what SIP does when it makes callbacks for virtual
methods. We'll need to do the same thing in the EventThunker
and anywhere else that we're doing callbacks ourselves. NOTE:
Currently there is some Classic code alread in use there. I
need to at least verify that it is doing the right thing...
* Can we reuse the GIL handling functions from Classic wxPython or
do they need to be rewritten?

View File

@@ -41,8 +41,8 @@ class Configuration(object):
'-o', # turn on auto-docstrings
#'-e', # turn on exceptions support
'-T', # turn off writing the timestamp to the generated files
#'-g', # always release and reaquire the GIL
#'-r', # turn on function call tracing
'-g', # always release and reaquire the GIL
#'-r', # turn on function call tracing
'-I', 'src'
])