Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reserve cpu time for vfp thread
Message
From
12/09/2006 13:26:15
 
 
To
12/09/2006 03:22:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01152931
Message ID:
01153094
Views:
37
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>is it possible to reserve a certain maximum cpu power to process a tread ? So when the vpf is dealing with a heavy calculations the pc is not blocking ?

You could take a look at the application .AutoYield property and the DOEVENTS command. For example, putting DOEVENTS calls in loops can help improve responsiveness of other apps running on the same box.

It's difficult to get some single VFP commands such as a long-running SELECT - SQL to yield the processor. However in such a case you might experiment with something like this:
SELECT ;
    SomeColumnsIWant ;
    , SomeUDF() AS DummyColumn ;
    ...

* SomeUDF
FUNCTION SomeUDF

DOEVENTS

RETURN SomeDummyValue
I haven't tested the above code at all, it's just a concept. It might slow down performance a lot.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform