Project

General

Profile

Actions

Emulator Issues #8311

closed

Netplay shouldn't use an idle loop

Added by degasus over 9 years ago.

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?


Related issues 1 (0 open1 closed)

Has duplicate Emulator - Emulator Issues #8284: Netplay is broken on Linux (extremely slow, even the chat messages lag)Duplicate

Actions
Actions

Also available in: Atom PDF