Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Sleep(0), Sleep(1) (https://www.delphipraxis.net/138846-sleep-0-sleep-1-a.html)

Shadow 18. Aug 2009 13:58


Sleep(0), Sleep(1)
 
Hallo,

vielleicht kann mir jemand von euch mal kurz auf die Sprünge helfen ?

Wie verhalten sich die beiden genannten Prozeduren in einem Thread ?

Ist es richtig, dass bei sleep(0) der Thread nur dann den Prozessor ab gibt, wenn ein Thread mit gleicher
oder höherer Priorität bereit ist ?

Bei Sleep(1) gibt der Thread den Prozessor definitiv ab oder?

Gibt Sleep(0) sofort den Prozessor ab oder erst wenn die Zeitscheibe oder ähnliches abgelaufen ist ?

Frage über Fragen ;)


Wäre super wenn mir mal jemand auf die Sprünge hilft :)


Viele Grüsse,
Andre

sirius 18. Aug 2009 14:00

Re: Sleep(0), Sleep(1)
 
Zitat:

Zitat von msdn
A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution.


Apollonius 18. Aug 2009 14:02

Re: Sleep(0), Sleep(1)
 
MSDN-Library durchsuchenSleep
Zitat:

This function causes a thread to relinquish the remainder of its time slice and become unrunnable for an interval based on the value of dwMilliseconds.


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:37 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz