Einzelnen Beitrag anzeigen

Benutzerbild von Assarbad
Assarbad

Registriert seit: 8. Okt 2010
Ort: Frankfurt am Main
1.234 Beiträge
 
#3

AW: Thread einem Core zuweisen

  Alt 11. Feb 2011, 15:06
- Sleep, damit Windows mal aus den Puschen kommt
MSDN-Library durchsuchenSleep mit 0 kann ich nur empfehlen. Es ist nicht soooo wichtig dort einen Wert größer Null zu geben, da 20ms ohnehin "relativ" sind (auf einem Rechner passiert da was, auf 'nem anderen eher noch nicht). Mit Sleep(0) forciert man die Abgabe der eigenen Rechenzeit.

Zitat von MSDN:
A value of zero causes the thread to relinquish the remainder of its time slice to any other thread that is ready to run. If there are no other threads ready to run, the function returns immediately, and the thread continues execution.
Windows XP/2000: 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. This behavior changed starting with Windows Server 2003.
Oliver
"... aber vertrauen Sie uns, die Physik stimmt." (Prof. Harald Lesch)
  Mit Zitat antworten Zitat