Svoboda | Graniru | BBC Russia | Golosameriki | Facebook

To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
Languages
Recent
Show all languages
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

HLT (x86 instruction)

From Wikipedia, the free encyclopedia

In the x86 computer architecture, HLT (halt) is an assembly language instruction which halts the central processing unit (CPU) until the next external interrupt is fired.[1] Interrupts are signals sent by hardware devices to the CPU alerting it that an event occurred to which it should react. For example, hardware timers send interrupts to the CPU at regular intervals.

Most operating systems execute a HLT instruction when there is no immediate work to be done, putting the processor into an idle state. In Windows NT, for example, this instruction is run in the "System Idle Process". On x86 processors, the opcode of HLT is 0xF4.

On ARM processors, the similar instructions are WFI (Wait For Interrupt) and WFE (Wait For Event).

YouTube Encyclopedic

  • 1/3
    Views:
    331
    1 797 886
    665
  • Hlt,SPHL,XTHL,NOP
  • The Fetch-Execute Cycle: What's Your Computer Actually Doing?
  • "xchg eax, eax" does not equal "nop" in the x86 64-bit architecture

Transcription

History on x86

All x86 processors from the 8086 onward had the HLT instruction, but it was not used by MS-DOS prior to 6.0[2] and was not specifically designed to reduce power consumption until the release of the Intel DX4 processor in 1994. MS-DOS 6.0 provided a POWER.EXE that could be installed in CONFIG.SYS and in Microsoft's tests it saved 5%.[3] Some of the first 100 MHz DX chips had a buggy HLT state, prompting the developers of Linux to implement a "no-hlt" option for use when running on those chips,[4] but this was fixed in later chips.

Intel has since introduced additional processor-yielding instructions. These include:

  • PAUSE in SSE2 intended for spin loops. Available to userspace (low-privilege rings).
  • MONITOR/MWAIT in SSE3 for thread synchronization.
  • TPAUSE (timed pause) and UMONITOR/UMWAIT (userspace monitor/mwait). Available to userspace.

Process

Almost every modern processor instruction set includes an instruction or sleep mode which halts the processor until more work needs to be done. In interrupt-driven processors, this instruction halts the CPU until an external interrupt is received. 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 for sleeping and idling. In most processors, halting (instead of looping) also reduces the latency of the next interrupt.

Use in operating systems

Since issuing the HLT instruction requires ring 0 access, it can only be run by privileged system software such as the kernel. Because of this, it is often best practice in application programming to use the application programming interface (API) provided for that purpose by the operating system when no more work can be done, such as Linux's sched_yield().[5] This is referred to as "yielding" the processor. This allows the operating system's scheduler to decide whether other processes are runnable; if not. If every process is sleeping or waiting, it will normally execute a HLT instruction to cut power usage until the next hardware interrupt.

See also

References

  1. ^ "Intel 64 and IA-32 Architectures Software Developer's Manual: Instruction Set Reference A-Z". Retrieved 2012-03-01.
  2. ^ "Why does DOS use 100% CPU under Virtual PC?". microsoft.com. Retrieved 18 November 2018.
  3. ^ "POWER.EXE and Advanced Power Management (APM) Support". Archived from the original on 2014-09-27. Retrieved 2015-09-27.
  4. ^ "The Linux BootPrompt-HowTo". www.faqs.org. Retrieved 18 November 2018.
  5. ^ "sched_yield(2) - Linux manual page". Retrieved 2020-09-02.
This page was last edited on 3 June 2024, at 03:43
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.