From HELP I read the comment:
Isn't that ok, as long as the thread is using up the CPU only in its allocated time-slice?
I thought Windows was pre-emptive - that it forced threads to give up CPU usage once their time-slice was over. So how is it that an application can seem to hog CPU time and slow down other threads/processes - unless Windows is giving it an inordinate number of time-slices?
The Help statement also made me wonder what is a tight loop?
Is there such a thing as a not-tight loop?
We've all seen apps hog CPU time. I just haven't thought about it enough to have asked the questions above.
Can someone clarify the big picture for me?
When Code is running in a tight Loop, it is quite possible to use up 100% of the available 'CPU time
I thought Windows was pre-emptive - that it forced threads to give up CPU usage once their time-slice was over. So how is it that an application can seem to hog CPU time and slow down other threads/processes - unless Windows is giving it an inordinate number of time-slices?
The Help statement also made me wonder what is a tight loop?
Code:
For i = 1 to 10 '? tight Next i For i = 1 to 10 '? tight j = 2 * i Next i For i = 1 to 10 '? tight Sleep 1000 Next i
We've all seen apps hog CPU time. I just haven't thought about it enough to have asked the questions above.
Can someone clarify the big picture for me?
Comment