Bram Stolk  <[EMAIL PROTECTED]> 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
says:

"""
This is so common that a pair of macros exists to simplify it:

        Py_BEGIN_ALLOW_THREADS
        ...Do some blocking I/O operation...
        Py_END_ALLOW_THREADS
"""

-- 
\S -- [EMAIL PROTECTED] -- 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
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to