[LAD] [somewhat OT] semaphores in python

Emanuel Rumpf xbran at web.de
Wed Aug 27 14:35:02 UTC 2008


2008/8/26 Fons Adriaensen <fons at kokkinizita.net>:
>
> BUT: the python interpreter will release the GIL every
> so many bytecode instructions. There is AFAICS nothing
> that would prevent it from doing this in between the two
> operations that have to be atomic - it doesn't know they
> have to be.
>

Maybe this will bring you further :

PyGILState_STATE gil_state
gil_state = PyGILState_Ensure()

// do anything
PyGILState_Release( gil_state )


see also:
http://docs.python.org/api/threads.html



More information about the Linux-audio-dev mailing list