[PyKDE] Threads & PyQt 3?

gvermeul at polycnrs-gre.fr gvermeul at polycnrs-gre.fr
Sun Feb 24 09:29:59 GMT 2002

> Gerard Vermeulen wrote:
> > 
> > Great Phil,
> > 
> > but I really think that adding the Py_BEGIN_ALLOW_THREADS and
> > Py_END_ALLOW_THREADS to the wrappers may really help to run threads
> > more smoothly, in case that the wrapped functions ask a lot of CPU time
> > or require I/O.
> Currently this is done (via sipReleaseLock() and sipAcquireLock()) for
> calls that handle Qt events (eg. QApplication.exec_loop()). There
> shouldn't be any problem with adding calls to things like
> QFile.readBlock() etc. Or are you suggesting adding them for every
> single Qt call?
I did not realize that these macros were already handled via those
..Lock() functions. I did just a few tests and to my surprise
multithreading worked better than I expected.

Yes, I was thinking to adding them to every Qt call. Of course that
is a naive brute force approach. It should be better to add
a sip directive, allowing thread switching in the Qt calls that
may demand a lot of time.


This message was sent using Endymion MailMan.

More information about the PyQt mailing list