On 3/18/09, [email protected] <[email protected]> wrote:
>
>  > --
>  > Basically, just wrap I/O blocking code or CPU-intensive code in the
>  > following macros:
>  >   Py_BEGIN_ALLOW_THREADS
>  >     ...Do some time-consuming operation...
>  >   Py_END_ALLOW_THREADS
>  > --
>  >
>
>
> So I couldn't wait, over lunch I fired up the trusty live CD, installed
>  all the build dependancies and borrowed a webcam from my colleague...
>
>  and yes, these macros make a huge difference to responsiveness of the
>  gui/display.
>
>  Cool, eh.
>  Simon.

Sorry, I didn't realize your code was in C.  Yes, those macros are
needed, otherwise no other python threads will run while your code is
being executed!  In addition to wrapping functions that just take a
lot of time, you should also wrap everything that could possibly block
(including printf, and all blocking socket operations)

-Mark C.

_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to