diff options
author | Daniel M. Pelt <D.M.Pelt@cwi.nl> | 2015-08-10 16:22:19 +0200 |
---|---|---|
committer | Daniel M. Pelt <D.M.Pelt@cwi.nl> | 2015-08-10 16:22:19 +0200 |
commit | ee790c305942675e94ee66bfd24896d1ef61335a (patch) | |
tree | 6314fba17a77a377953da3b615a6a9016edee4cf | |
parent | 48531b4a4de3020e4c8e84eacbe9db6696adbfbd (diff) | |
download | astra-ee790c305942675e94ee66bfd24896d1ef61335a.tar.gz astra-ee790c305942675e94ee66bfd24896d1ef61335a.tar.bz2 astra-ee790c305942675e94ee66bfd24896d1ef61335a.tar.xz astra-ee790c305942675e94ee66bfd24896d1ef61335a.zip |
Release the gil in algorithm.run
-rw-r--r-- | python/astra/PyIncludes.pxd | 2 | ||||
-rw-r--r-- | python/astra/algorithm_c.pyx | 4 |
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): |