Jump to content

Talk:Sleep (system call)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Infinite loop

[edit]

Is the infinite wait loop talked about here acutally an event loop? --Abdull 15:50, 19 April 2007 (UTC)[reply]

Yes, so I changed it. — Loadmaster 15:15, 26 May 2007 (UTC)[reply]

This article and Sleep mode are both stub and about the same subject. I propose a merge. --Android Mouse 17:27, 24 May 2007 (UTC)[reply]

No, they are not. The Sleep mode article is about a stand-by power-down of a device, causing all programs to stop execution; this article is about the operating system call that causes a program/process/thread to become inactive, allowing other processes to continue execution. Two different concepts, two different articles. (I remember looking at the Sleep mode article before I created this one.) — Loadmaster 15:12, 26 May 2007 (UTC)[reply]
I understand, but I fail to see why the system call is notable enough for its own article. The information would be better merged to the other article. We don't have a seperate article for Shutdown (a much older concept), and infact that article is over even a broader subject than both of these articles. --Android Mouse 04:23, 15 June 2007 (UTC)[reply]

Scratch that, I misread the article and your response. I thought the you (and the article) were refering to system call that put the computer into sleep mode, not the sleep system call for individual threads and processes. Sorry for the misunderstanding. --Android Mouse 04:26, 15 June 2007 (UTC)[reply]

sleep and threads

[edit]

Thread (computer science) says that threads can go to sleep. Is this the same (by concept) sleep as the sleep in this article? Wouldn't it then make sense to restate the first sentence as: A computer program (process, thread or task) may sleep, which places it into an inactive state for a period of time.? --Abdull (talk) 15:10, 21 November 2007 (UTC)[reply]

Sleep vs. Stand by

[edit]

What's the differnce between sleep and stand by? --Marshall T. Williams (talk) 19:54, 1 January 2009 (UTC)[reply]

Low level functionality

[edit]

Seriously, who wrote this section? It is so wrongly based on Java implementation peculiarities rather than operating system support and incorrect on almost all acounts. For example, there is no such thing as a Wait syscall under Windows at all. — Preceding unsigned comment added by 92.192.119.211 (talk) 16:33, 26 October 2012 (UTC)[reply]

C code inside of a while loop.

[edit]

The C code is inside of a while loop, but its never explained why this is so.

If we wanted to show off the use of a sleep function, why not just have it be:

Sleep(2*1000) //Sleep for 2 seconds

Robodoggy (talk) 23:23, 30 October 2012 (UTC)[reply]

Uninterruptible sleep and Sleep system call?

[edit]

What's the relationship between "Uninterruptible sleep" and "Sleep system call"?

The previous one has nothing to do with the system call which happened to have a similar name. Yegle (talk) 06:17, 28 February 2014 (UTC)[reply]

Sleep and moving the system clock backwards

[edit]

Is it worth pointing out the interactions with the Sleep() function and how it's affected by setting the system clock backwards?

Depending on the OS, OS versions, and how programming standard libraries interface with it, sleep can do two things. I've given examples below.

  • sleep for 15 seconds, then set the system clock back 1 hour. Thread sleeps for at least 1 hour and 15 seconds
  • sleep for 15 seconds, then set the system clock back 1 hour. Thread sleeps for at least 15 seconds

It seems the POSIX standard indirectly implies the latter (https://man7.org/linux/man-pages/man2/clock_settime.2.html#VERSIONS), as does recent the Windows 11 OS.

Also somewhat related, the MSVC C++17 standard library implementation "std::this_thread::sleep_for" and "std::this_thread::sleep_until" uses the former. That is until v17.9.0 where "sleep_until" uses the latter (https://github.com/microsoft/STL/issues/718). In both cases the C++ standard says it's an implementation decision what happens. I expect other programming languages' standard libraries to have similar confusing quirks. JodiTheEntitled (talk) 21:50, 3 March 2024 (UTC)[reply]