Luciano Cattani wrote: > --- Lun 19/10/09, Christopher Coale <[email protected]> wrote: > >> Da: Christopher Coale <[email protected]> >> Oggetto: Re: [c-prog] Infinite loop? >> A: [email protected] >> Data: Lunedì 19 ottobre 2009, 06:58 >> >> Thomas Hruska wrote: >> >> In another situation, I wrote a program similar to yours. Only I >> changed the priority of the process to REALTIME_PRIORITY_ CLASS before >> the while loop by calling SetPriorityClass( ). Upon running the program, >> it instantly and completely froze Windows, forcing me to hit the reset >> button on the box. There was no way to see what was going on, but the >> program was surely spinning the CPU as fast as it could possibly go. No >> damage done. > > Modern CPUs run programs in two main "modes" (they are called RINGS by Intel > - other CPU do have similar concepts): > > 1. user (ring 3) > 2. kernel (ring 0) > > In user mode, no change on the priority class of a task _should_ freeze the > OS: if windows froze than I think it shouldn't be called 'an Operating > System'. > Some parts of device drivers that run in kernel mode may actually freeze the > system.
The three finger salute (Ctrl-Alt-Del) didn't work to bring up Task Manager and the mouse cursor didn't move at all. I'm pretty sure that constitutes as frozen. The description for REALTIME_PRIORITY_CLASS seems to imply that Windows gives EVERY timeslice to the program in question. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
