[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] Threads & PyQt 3?
From: Phil Thompson <phil () river-bank ! demon ! co ! uk>
Date: 2002-02-24 20:06:29
[Download RAW message or body]
gvermeul@polycnrs-gre.fr wrote:
>
> > 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.
The directive is /ReleaseLock/. I'll add it to all the read/write
methods I can find.
Phil
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic