Le 01/05/2015 02:35, Steven D'Aprano a écrit :
Cython has prange. It replaces range() in the for loop but runs the loop body in parallel using openmp:
If you still wish to argue for this, one thing which may help your case
is if you can identify other programming languages that have already
done something similar.
from cython.parallel import prange
cdef int func(Py_ssize_t n):
cdef Py_ssize_t i
for i in prange(n, nogil=True):
if i == 8:
with gil:
raise Exception()
elif i == 4:
break
elif i == 2:
return i
This is an example from the cython documentation: http://docs.cython.org/src/userguide/parallelism.html