Hi Tlink,
A simple while loop in the program will eat all the CPU time.
e.g.
While Ture
.....
Wend
Windows schedule the threads based on the priority(Normal/High...) you will
find that in the Task Manager if no process is running, the Idel process
will occupy the almost 100% CPU, this is tell you that current the CPU is
idle. Once another process with higher priority want CPU time, the idle
process's CPU time will decrease.
So commonly it is not proper to run a loop all the time without any thread
sleep, because that is tell the CPU you want the CPU time all the time, so
that CPU will be occupied by your process if there is no other higher
priority process want it.
I think you may try Cor's suggestion, or check every 1 second or more. Or
When you code is modifying the database, try to fire event to tell
something had happened.
e.g.
While True
checkdatabase()
Thread.Sleep(1000)
Wend
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.