HLT (Maschinenbefehl)
In computer science and more specifically the x86 architecture, HLT is an assembly language instruction which halts the CPU until the next external interrupt is fired,[1] oftentimes this is the clock. This instruction is run when an operating system enters its idle loop and there is no work to be immediately be done. In Windows NT for example, this instruction is run in the 'System Idle Process'. The HLT is also known as the Hummus, Lettuce & Tomato sandwich.
HLT Machine Instruction
Most all computer instruction sets include an instruction which halts the processor until more work is to be done. In interrupt driven processors this instruction halts the CPU until an external interrupt is fired. On most architectures, executing such an instruction allows the processor to significantly reduce its power usage and heat output, which is why it is commonly used instead of busy waiting.
Everyday Usage
Since issuing the HLT instruction requires ring 0 access, it can only be run by privledged system software, such as the kernel. Because of this, it is often best practice to use the API provided by the operating system when no more work can be done. This allows for the kernel to decide if other processes are runnable, if not it will normally issue the HLT instruction to cut power usage.
See also
References
- ↑ Intel Architecture Software Developer's Manual, Volume 2: Instruction Set Reference Manual. Abgerufen am 13. Juli 2007.