releasing interpreter lock in custom code?
siona at chiark.greenend.org.uk
Thu May 11 13:08:03 CEST 2006
Bram Stolk <bram at geenspam.sara.nl> wrote:
>I've implemented, in C, a function that does a lot of I/O, and thus
>can block for a long time.
>If I execute this function in my Python script, it does not
>relinquish the global interpreter lock, like Python's native
>blocking functions do, like I/O funcs, and time.sleep() func.
>How can I have my func release the lock?
http://docs.python.org/api/threads.html is the first hit on
searching docs.python.org for "global interpreter lock". It
This is so common that a pair of macros exists to simplify it:
...Do some blocking I/O operation...
\S -- siona at chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
___ | "Frankly I have no feelings towards penguins one way or the other"
\X/ | -- Arthur C. Clarke
her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump
More information about the Python-list