Tuvas wrote:
> The read function used actually is from a library in C, for use over a
> CAN interface. The same library appears to work perfectly find over C.
[...]
> When nothing is happening, the thread runs pretty consistantly at 1
> second. However, when it is doing IO through this C function or
> whatever, the length of time increases, for the time.sleep() function.
> Kind of strange, isn't it? I can explain in more detail if it's needed,
> but I don't know how much it'll help...

That's enough detail that I'll take a most-likely-guess:

When your C function runs, by default you hold the aforementioned
Global Interpreter Lock (GIL). Unless you explicitly release it,
you will hold it until you return, and nothing else will run.
Python's own I/O operations always release the GIL right before
calling any potentially-blocking operation, and reacquire it
right after.

See:

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


-- 
--Bryan
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to