Actions
Emulator Issues #8311
closedNetplay shouldn't use an idle loop
Status:
Fixed
Priority:
Urgent
Assignee:
-
Category:
Netplay
% Done:
0%
Operating system:
N/A
Issue type:
Bug
Milestone:
Current
Regression:
Yes
Relates to usability:
No
Relates to performance:
Yes
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
Description
We use an idle loop in the netplay code:
https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Core/NetPlayServer.cpp#L108
This waste lots of CPU, and has some critical components in it:
- m_ping_timer.GetTimeElapsed() <- syscall, so we'll generate as much syscalls as our operation system can handle
- std::lock_guard<std::recursive_mutex> lks(m_crit.send) <- this mutex may be locked almost 100% of the time
A good designed way would be to use locking events. Does enet support an event based usage?
Actions