mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Use PAUSE in spinwait
Using PAUSE in a tight loop allows other logical cores on the same physical core to make use of more of the core's resources.
This commit is contained in:
@@ -17,6 +17,6 @@ void
|
||||
clock::spinwait(uint64_t us) const
|
||||
{
|
||||
uint64_t when = value() + us;
|
||||
while (value() < when);
|
||||
while (value() < when) asm ("pause");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user