A computer program (process, task, or thread) may sleep, which places it into an inactive state for a period of time. Eventually the expiration of an interval timer, or the receipt of a signal or interrupt causes the program to resume execution.
Contents |
A typical sleep system call takes a time value as a parameter, specifying the minimum amount of time that the process is to sleep before resuming execution. The parameter typically specifies seconds, although some operating systems provide finer resolution, such as milliseconds or microseconds.
On Windows, the Sleep()
function takes a single parameter of the number of milliseconds to sleep. [1] The Sleep()
function is included in kernel32.dll, but no sleep command (executable) is natively available for scripts (batch files). It can be found in collections of Windows utilities like Windows 2003 Resource Kit. [2]
On Unix-like operating systems, the sleep()
function is called providing a single parameter of type unsigned integer of the number of seconds to sleep. [3] (For more precise sleep times one can use the usleep()
function.) [4]
In Windows OS: <source lang="c"> while (myInt <= 100) {
Sleep(2*1000); // Sleep for 2 seconds
} </source>
In Unix: <source lang="c"> while (myInt <= 100) {
sleep(2); // Sleep for 2 seconds
} </source>
Sleep causes the thread or process to enter the Not Runnable state. This allows the CPU to suspend the thread or process and continue executing other threads or processes until the sleep has finished, and the thread or process is allowed to continue executing. On Windows systems the sleep system call is non-interruptible[dubious ], which differs from the Wait system call, which can be interrupted.[5][6] However, some functions labeled sleep()
are alterable by design[7]. On Unix system signals interrupt system calls, including sleep()
.[8] Sleep often leads to poor code design and the wait or nanosleep functions are preferable.
Some system programs that never terminate execute an event loop, going to sleep at the start of each cycle and waiting for some event to awaken them. Once an event is received, the program services the event, then returns to the beginning of the next wait cycle.
Other programs periodically poll for events by going to sleep and resuming execution after a specific interval of time. Once execution is resumed, the program polls for events or status changes, and then services any that occurred while it was asleep. After servicing the events, the program then goes to sleep again for the next time interval. Certain kinds of heartbeat events or keep-alive signals can be generated by these kinds of programs.
An uninterruptible sleep state is a sleep state that won't handle a signal right away. It will wake only as a result of a waited-upon resource becoming available or after a time-out occurs during that wait (if specified when put to sleep). It is mostly used by device drivers waiting for disk or network IO (input/output). When the process is sleeping uninterruptibly, signals accumulated during the sleep will be noticed when the process returns from the system call or trap.
In Unix-like systems the command 'ps -l
' uses code "D
" for the uninterruptible sleep state of a process.
Human sleep and animal sleep (non-human) are a form of rest.
Sleep or Sleeping can also refer to:
Sleep on Macintoshes running on OS X consist of the traditional sleep, Safe Sleep, and Power Nap. In System Preferences, Safe Sleep is referred to as sleep. Since Safe Sleep also allowed state to be restored in an event of a power outage, unlike other operating systems, hibernate was never offered as an option.
In 2005, some versions of Macs running Mac OS X v10.4 began to support Safe Sleep. The feature saves the contents of volatile memory to the system hard disk each time the Mac enters Sleep mode. The Mac can instantaneously wake from sleep mode if power to the RAM has not been lost. However, if the power supply was interrupted, such as when removing batteries without an AC power connection, the Mac would wake from Safe Sleep instead, restoring memory contents from the hard drive.
Safe Sleep capability is found in Mac models starting with the October 2005 revision of the PowerBook G4 (Double-Layer SD). Mac OS X v10.4 or higher is also required. A hack enabled the feature as well on older Macs running Mac OS X v10.4.
Pandemonium! is the second and final studio album from the R&B/pop group B2K. The album was released through Epic on December 10, 2002.
The album debuted at number ten on the Billboard 200 and at number three on Top R&B/Hip-Hop Albums selling 194,000 the first week. The album's lead single was "Bump, Bump, Bump", which reached number one on the Billboard Hot 100, becoming the group's first top ten and number one single. The second single was "Girlfriend", which peaked at #30 on the Billboard Hot 100. A third single from the album was released, Bump That, but the song did not manage to make the Billboard Hot 100 or the Hot R&B/Hip-Hop Songs. The fourth single from the album was "What a Girl Wants". It contains a sample of the 1999 version of "What a Girl Wants" from Christina Aguilera. The song peaked at #47 on the Hot R&B/Hip-Hop Songs.
Pandemonium is the ninth studio album by English rock band Killing Joke, released on 2 August 1994 by record label Butterfly. This album marked Killing Joke's return after a four-year-long hiatus, the longest the band has taken since it was initially founded. This album also featured the return of founding member Martin "Youth" Glover, who replaced Paul Raven on bass.
Frontman Jaz Coleman considered Pandemonium to be a conceptual album on the external influence of Arabic music that was spread throughout the entire album. It also incorporated his perspective on life, which is apparent in songs such as "Labyrinth" and "Pleasures of the Flesh".
The title track, as well as "Communion" and "Whiteout", would become live staples of the band.
Pandemonium was released on 2 August 1994 by record label Butterfly.
The album was reissued in remastered form in 2005, featuring two new tracks: a remix of "Another Cult Goes Down" and an experimental dub remix of "Pandemonium".
Pandemonium is the name of multiple Gerstlauer steel spinning roller coasters that are located at several Six Flags theme parks including Six Flags New England, Six Flags Fiesta Texas, Six Flags St. Louis, Six Flags Over Texas, and previously at Six Flags Discovery Kingdom which was relocated to Six Flags México as The Joker. Its design consists of several cars holding four riders each. While the cars traverse the track, they spin around according to the angle of the track and the shifts in the riders' weight. All five rides were installed by Ride Entertainment Group, who handle all of Gerstlauer's operations in the Western Hemisphere.
The original Pandemonium opened at Six Flags New England on April 14, 2005 as Mr. Six's Pandemonium (Six Flags dropped the "Mr. Six's" prefix one year later). It was the only Gerstlauer spinning roller coaster at a Six Flags park until 2007 and 2008 when Six Flags opened another 4 spinning roller coasters — all named Tony Hawk's Big Spin. The rides were originally billed as the "total Tony Hawk experience" and were designed to have the look and feel of giant red-and-black skateparks.