Hello, I ran into an interesting problem today. It doesn't seem like Cython respects the `nogil` statement on extern cpp functions. I am trying to use a blocking I/O function, and am running it in secondary thread so I can use another library function to cancel it.
I have tried it both on the `extern` line: cdef extern from "digitalpersona/dpfp_api.h" nogil: uint32_t DPFPGetEvent(dp_uid_t* pDevUID, dp_device_event_t** ppEvent, uint32_t uTimeoutMsec) and on the function itself: cdef extern from "digitalpersona/dpfp_api.h" nogil: uint32_t DPFPGetEvent(dp_uid_t* pDevUID, dp_device_event_t** ppEvent, uint32_t uTimeoutMsec) nogil Either way, this statement still blocks other threads: res = dpfp_api.DPFPGetEvent(pIdDev, &pEvent, dpfp_api.DP_TIMEOUT_INFINITE) While this statement does not: with nogil: res = dpfp_api.DPFPGetEvent(pIdDev, &pEvent, dpfp_api.DP_TIMEOUT_INFINITE) All variables used (res, pIdDev, pEvent) are C variables. Obviously this is not a huge issue, as I can bypass the GIL using `with nogil`. But I figured it would be a good idea to report it anyway. Ryan Pessa AerisPOS Project Manager / Developer Essential Elements <http://www.essential-elements.net/> | AerisPOS<http://www.aerispos.com/>
_______________________________________________ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel