Calling python from C with OpenMP

Øystein Schønning-Johansen oysteijo at gmail.com
Fri May 13 16:16:58 EDT 2016


On Friday, May 13, 2016 at 7:12:33 PM UTC+2, MRAB wrote:
> Every PyGILState_Ensure call must be matched with a PyGILState_Release 
> call. The way it's currently written, it won't call PyGILState_Release 
> if ret is NULL.

Yeah, that's tiny bug, however it is not the main problem...
 
> However, I don't think you'll gain much here because you can gain from 
> multi-threading only if the threads can run in parallel. You need to 
> hold the GIL while making Python calls, and only 1 thread can hold the 
> GIL at any time.

In addition to the fact that it still does not work, what you here point out, is the main problem. I actually think I'm giving up for now. Maybe I'm able to solve this later.... (when python does not use a GIL anymore...?)

Thanks to Sturla and MRAB anyway!
-Øystein




More information about the Python-list mailing list