On Fri, 24 Apr 2009, Pritpal Bedi wrote:

Hi Pritpal,

> I found the reason.
> do while .t.
>    if Inkey() == K_ESC
>       EXIT
>    endif
> enddo
> Inkey() without parameters is the culprit.
> Changing it to inkey( 0.1 ) did the trick. 
> I could not reproduce this problem in GTWVT.
> So I assume the event dispatching by QT engine
> is somewhat different than Windows itself.
> Przemek, can we implement in Inkey() some very 
> small value to release the CPU cycles ?

I'm afriad it's not possible.
Inkey() release CPU only when called with some timeout parameter or 0.
Adding CPU release code to each inkey() call can kill the performance
of some which makes sth like:

   while !eof() and inkey()!=K_ESC
      [...]
      dbskip()
   enddo

because on some system the minimal interval can be quite huge, f.e.
10 milliseconds so in the above example skipping throw 1000 records
will took 10 seconds only for process sleeping.

> PS : To check above just change Inkey() to Inkey(0.1)
> in the mainloop of wvtext.prg.

I still haven't working environment with new Qt4.5.
In my systems the Qt is important part of the whole system
and I cannot easy add new Qt library without interactions
with existing binaries so I cannot make any tests yet with
final application. So far I only made some basic compilation
tests with Qt4.4 I have in my system but I cannot run final
binaries due to GPF.
I do not know what is the exact problem but the main difference
between inkey() and inkey(0.1) is activating idle proc. One of
jobs made by idle proc is exacting garbage collector. Maybe you
can reach the effect you are looking for by direct executing
hb_gcAll( .f. ).

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to