• Zhiyi Zhang's avatar
    Revert "ntdll: Call usleep() instead of NtYieldExecution() in NtDelayExecution().". · fc3b2eba
    Zhiyi Zhang authored
    Manual tests on Windows 10 show that calling Sleep(0) or NtDelayExecution() with zero timeout in a
    loop do consume 100% of a CPU core, which is closer to the behavior of NtYieldExecution() than
    usleep(0). usleep(0) gives up the remaining timeslices even if there are no other threads to switch
    to, causing low utilization of CPU and performance issues.
    
    The original patch is b1a79c6b and the idea is to use usleep(0) to avoid a thread taking 100% of a
    CPU core for StarCraft 2 and Shadow of the Tomb Raider. However with wine-7.22, reverting the
    usleep(0) patch causes no behavior changes. For Shadow of the Tomb Raider, the 100% CPU issue is
    gone with or without the patch. For StarCraft 2, there is always a thread taking 100% CPU even with
    the patch. After discussing with Matteo, we decided it's better to revert the patch.
    
    Fix Mortal Kombat X performance drop during tower selection and Ragnarok Online bad performance.
    
    This reverts commit e86b4015.
    
    Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53327
    fc3b2eba
Name
Last commit
Last update
..
cdrom.c Loading commit data...
debug.c Loading commit data...
dwarf.h Loading commit data...
env.c Loading commit data...
file.c Loading commit data...
loader.c Loading commit data...
loadorder.c Loading commit data...
process.c Loading commit data...
registry.c Loading commit data...
security.c Loading commit data...
serial.c Loading commit data...
server.c Loading commit data...
signal_arm.c Loading commit data...
signal_arm64.c Loading commit data...
signal_i386.c Loading commit data...
signal_x86_64.c Loading commit data...
socket.c Loading commit data...
sync.c Loading commit data...
system.c Loading commit data...
tape.c Loading commit data...
thread.c Loading commit data...
unix_private.h Loading commit data...
virtual.c Loading commit data...