From d0e1ec8c48bbe2a5b341d5f3dd0c9cef5518788a Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Sat, 28 Jan 2017 22:46:23 -0800 Subject: [PATCH] add a usleep(0) to improve UDP performance on Windows (busy-loop eats all CPU time, other thread didn't proceed) --- examples/SharedMemory/PhysicsClientUDP.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/SharedMemory/PhysicsClientUDP.cpp b/examples/SharedMemory/PhysicsClientUDP.cpp index cd4cef440..e5aa46ad2 100644 --- a/examples/SharedMemory/PhysicsClientUDP.cpp +++ b/examples/SharedMemory/PhysicsClientUDP.cpp @@ -473,7 +473,7 @@ bool UdpNetworkedPhysicsProcessor::processCommand(const struct SharedMemoryComma while (m_data->m_hasCommand && (timeout-- > 0)) { -// b3Clock::usleep(100); + b3Clock::usleep(0); } #if 0