summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2015-08-11 11:51:45 +0200
committerWillem Jan Palenstijn <wjp@usecode.org>2015-08-11 11:51:45 +0200
commit60e726c9f6aab0ff66a46f9df3db975cfac84399 (patch)
tree6314fba17a77a377953da3b615a6a9016edee4cf
parent48531b4a4de3020e4c8e84eacbe9db6696adbfbd (diff)
parentee790c305942675e94ee66bfd24896d1ef61335a (diff)
downloadastra-60e726c9f6aab0ff66a46f9df3db975cfac84399.tar.gz
astra-60e726c9f6aab0ff66a46f9df3db975cfac84399.tar.bz2
astra-60e726c9f6aab0ff66a46f9df3db975cfac84399.tar.xz
astra-60e726c9f6aab0ff66a46f9df3db975cfac84399.zip
Merge pull request #88 from dmpelt/nogil
Release the gil in algorithm.run
-rw-r--r--python/astra/PyIncludes.pxd2
-rw-r--r--python/astra/algorithm_c.pyx4
2 files changed, 4 insertions, 2 deletions
diff --git a/python/astra/PyIncludes.pxd b/python/astra/PyIncludes.pxd
index 909f58f..35dea5f 100644
--- a/python/astra/PyIncludes.pxd
+++ b/python/astra/PyIncludes.pxd
@@ -143,7 +143,7 @@ cdef extern from "astra/Float32ProjectionData2D.h" namespace "astra":
cdef extern from "astra/Algorithm.h" namespace "astra":
cdef cppclass CAlgorithm:
bool initialize(Config)
- void run(int)
+ void run(int) nogil
bool isInitialized()
cdef extern from "astra/ReconstructionAlgorithm2D.h" namespace "astra":
diff --git a/python/astra/algorithm_c.pyx b/python/astra/algorithm_c.pyx
index 966d3d7..3231c1f 100644
--- a/python/astra/algorithm_c.pyx
+++ b/python/astra/algorithm_c.pyx
@@ -73,7 +73,9 @@ cdef CAlgorithm * getAlg(i) except NULL:
def run(i, iterations=0):
cdef CAlgorithm * alg = getAlg(i)
- alg.run(iterations)
+ cdef int its = iterations
+ with nogil:
+ alg.run(its)
def get_res_norm(i):