Using function pointers to methods of classes without the gil
You can use with gil: around the blocks that need the GIL, and then with nogil: around the important inner blocks that will take most of your run time. To give a trivial example from cython.parallel import prange cdef class Simulation: cdef double some_detail def __cinit__(self,double some_detail): self.some_detail = some_detail def do_long_calculation(self, double v): with … Read more