Wait state
A wait state refers to a delay encountered by a computer processor when it attempts to access external memory or other slower peripherals.
Microprocessors generally function at speeds significantly higher than the components that store data. For instance, in 2011, processors such as the Intel Core 2 and AMD Athlon 64 X2 operated at frequencies of several GHz, with clock cycles shorter than 1 nanosecond, whereas the latency of main memory typically ranged between 15 and 30 ns. Additionally, some secondary CPU cache levels operate at lower speeds compared to the core.
When a processor requests data from external memory, it sends the address via the address bus and must wait for the response, which may take dozens or even hundreds of clock cycles. Each cycle spent in this waiting period constitutes a wait state.
The presence of wait states negatively impacts processor throughput. Contemporary processor architectures strive to reduce these delays by incorporating mechanisms such as CPU caches, instruction pipelines, instruction prefetch, branch prediction, and simultaneous multithreading. Although none of these approaches can completely eradicate wait states alone, their combined implementation greatly enhances performance.
Energy conservation
Wait states can contribute to lowering the processor's power consumption by enabling the main clock to slow down or temporarily halt during idle periods. This reduction in activity helps maintain cooler CPU temperatures and prolongs battery life in mobile devices.
Alternative meaning on IBM mainframes
Within the context of IBM mainframes, a wait state signifies a CPU stoppage often caused by critical errors such as unrecoverable faults occurring during the operating system startup process (IPL). This condition is indicated when bit 14 of the PSW is set to 1, with additional bits encoding a wait state code that specifies the reason. In z/Architecture mode, this code is located in bits 116 through 127.