mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-18 08:14:22 +00:00
use SPSC queue notify/wait in the symbol queue to reduce the response latency of the symbol worker
This commit is contained in:
@@ -2066,6 +2066,8 @@ void Profiler::Worker()
|
||||
connActive = HandleServerQuery();
|
||||
if( !connActive ) break;
|
||||
}
|
||||
if ( !m_symbolQueue.empty() )
|
||||
m_symbolQueue.notify();
|
||||
if( !connActive || ShouldExit() ) break;
|
||||
}
|
||||
if( ShouldExit() ) break;
|
||||
@@ -3657,7 +3659,7 @@ void Profiler::SymbolWorker()
|
||||
s_symbolThreadGone.store( true, std::memory_order_release );
|
||||
return;
|
||||
}
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );
|
||||
m_symbolQueue.wait( 20 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user