Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fox and the Processor 1

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,816
JP
All,
Does anyone have any way of controling the "amount" of processor that VFP gets? I have noticed that on some operations (heavy table processing, SQL Selects, intensive stuff) that the CPU gets almost 100% utilized, and this can kill simple functionality like accessing Outlook (which is strange, because other applications like FireFox browser have not issue...) Is it possible to only allow the fox application to only get a maximum % of CPU?


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
I am not sure but the SYS(3050) might do what you want.

Mark Davies
Warwickshire County Council
 
You should be able to set it's priority (e.g. in task manager), but I don't have a coding example. I assume you realize it'd impact performance.

Brian
 
Brian,
Yeah, performance isn't in issue in this case, as it's impacting performance of my other applicaitons, and that is bad. The processing that is running is not "As fast as possible" critical, it can run (and will run for months in some cases actually), I don't want it impacting my other apps in the mean time.
Thanks for the advice though.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Brilliant mate, thanks for that.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Scott,

I'm very interested in this process.

I have tried the code referred to and I am not getting a change in the process values although the thread values are set correctly. Changed from -2 to 2

To investigate I have added the PID column to Task Manager and the first thing I notice is that the value for the Process ID returned in the code (hProcess) is not that shown in TM for VFP6. In fact the returned number does not appear in the Process List.
I manually changed the value in the code after the function was run to that in TM but I got zero values everywhere.

I added
Code:
?"Process Number - PID",OpenProcess(;
    BITOR(PROCESS_QUERY_INFORMATION,PROCESS_VM_READ),;
    0, GetCurrentProcessId())
 ?'Thread Value '+ transform(GetCurrentThread())
to get the value

Did you have success?

PW
 
PW,
For now, I've just changed manually... I've been really busy, so the manual work around for the moment is okay, but I would ultimatly like to get it automated, so that it will set itself when the app is launched. I'm using VFP9, and will give it a try in the next day or so, and let you know what I get back.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Scott,

Looking forward to your report - this will be a real boon in my app.

PW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top