100% usage on Client PC ?'s

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I just delivered a windows client .net app and have noticed on client Pc, and for that matter on dev PC, the CPU in the Task manager is pinged at 100%. Yet the PC acts fine. You can launch IE and other apps with no lag.

My question is, why does it show up like that?

App is minimised and hidden and has a thread running that scans a folder on client pc for a file type. This loop is continuous. Only way to kill app is thru the Task manager processes. Thats how they wanted it.

Anyone explain the 1005 usage? App is 108k big and was compiled for .NET 1.1

Thanks
Deasun
 
This loop is continuous.

This is why your CPU usage is at 100%. You've got two options here:

1) Call Thread.Sleep(1000) to pause for a second [1000 milliseconds]
after each iteration of the loop.

or....

2) Instead of polling for the file continually, use the
FileSystemWatcher to notify you when the file in question is available.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top