Page 2 of 2

Re:jmp $ or hlt?

Posted: Sun Mar 26, 2006 1:45 pm
by paulbarker
Theres nothing wrong with it it's just "non-standard", and I don't like it myself.

Maybe it's a carry over from applications. When main() finishes, the program stops. To some people (like me :) ), it's counter-intuitive to continue processing events/interrupts after the main function has returned.

All I suggest is that you comment it well.

Re:jmp $ or hlt?

Posted: Mon Mar 27, 2006 10:41 am
by Pype.Clicker
Candamir wrote:

Code: Select all

hltloop:
   hlt
   jmp hltloop
There you had to implement SETI or whatever...
usually, that's not the way you make it. The "idle loop" is there for cases where system is idle. Screensavers or Seti@HOME are rather low-priority threads that are started when the system detects no activity for a given period of time.

The idle loop, instead, is always there, as soon as there's no thread ready in the system, it gets executed until any thread is ready.