Release processor for other tasks 
Author Message
 Release processor for other tasks

Hey everyone,

I have an app that runs on an NT machine.
It executes a bunch of steps inside a For/Next loop.
I have "DoEvents" scattered throughout, but the NT Task Manager shows the
processor usage at 100% during the loop.
The only time I notice processor usage drop is when I shell out to execute
another EXE and wait for it to finish.

DoEvents is working and letting the processor do other stuff, but
it just seems to me that VB shouldn't hog all the resources like that.

Any help would be appreciated...

--
-Shane Russell-
[Remove the "no" and "spam" from my address to reply]



Mon, 08 Oct 2001 03:00:00 GMT  
 Release processor for other tasks
Quote:

>I have "DoEvents" scattered throughout, but the NT Task Manager shows the
>processor usage at 100% during the loop.

<cut>

DoEvents will allow other things to happen, but it is still code within your
application that is checking the message queues and dealing with things.  In
effect you are taking over part of the OS's job for a brief period.  As far
as the OS is concerned your app is running all the time so you show up as
100% active.  You can use the Sleep API to relinquish control briefly and
that will cause your stats to drop.



Mon, 08 Oct 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ANNOUNCE: Beta-release of pre-processor for VB3.0

2. How can I release processor time in vbscript

3. Processor Serving? Tasking CPUs on a network

4. RELEASE OBJECTS --> RELEASE MEMORY

5. RELEASE OBJECTS --> RELEASE MEMORY

6. Project 2000 Service Release 1 Released

7. Assembly.GetTypes problem in Final Release vs Release Candidate

8. PRESS RELEASE: Xceed Zip Compression Library v3.0 released

9. BETA RELEASE: VB Power Tools Final Beta Release Notice

10. BETA RELEASE: VB Power Tools Final Beta Release Notice

11. BETA RELEASE: VB Power Tools Final Beta Release Notice

12. BETA RELEASE: VB Power Tools Final Beta Release Notice

 

 
Powered by phpBB® Forum Software