summaryrefslogtreecommitdiff
path: root/lang/python
diff options
context:
space:
mode:
authorDon Anderson <dda@ddanderson.com>2011-08-19 09:44:07 -0400
committerDon Anderson <dda@ddanderson.com>2011-08-19 09:44:07 -0400
commit580694128217c99520e127deab560c4a8035da41 (patch)
tree9ef6b3c6fcaabd6160adcfb5906f74b157c3b652 /lang/python
parent9c4dda346e5f34e0f3eabc6045ce92cf08d14187 (diff)
downloadmongo-580694128217c99520e127deab560c4a8035da41.tar.gz
Release the Global Interpreter Lock during all WT calls.
Otherwise there will be no real multithreading for WT. refs #31 --HG-- extra : rebase_source : 3c162bf4e42d21aebe4a3421d5d90feb2ae48ef4
Diffstat (limited to 'lang/python')
-rw-r--r--lang/python/wiredtiger.i11
1 files changed, 11 insertions, 0 deletions
diff --git a/lang/python/wiredtiger.i b/lang/python/wiredtiger.i
index 755a1b96876..42e7a5b29f3 100644
--- a/lang/python/wiredtiger.i
+++ b/lang/python/wiredtiger.i
@@ -66,6 +66,17 @@ DESTRUCTOR(wt_session, close)
/* Don't require empty config strings. */
%typemap(default) const char *config { $1 = NULL; }
+/*
+ * Release the Global Interpreter Lock so that WT calls will be
+ * multi-threaded. Using %exception to wrap every call seems to be a
+ * commonly used trick for this.
+ */
+%exception {
+ Py_BEGIN_ALLOW_THREADS
+ $action
+ Py_END_ALLOW_THREADS
+}
+
/*
* Error returns other than WT_NOTFOUND generate an exception.
* Use our own exception type, in future tailored to the kind