mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Don't thrash memory bandwith during file load.
This commit is contained in:
parent
c127f51767
commit
470600fbc2
@ -142,6 +142,7 @@ private:
|
|||||||
{
|
{
|
||||||
if( m_exit.load( std::memory_order_relaxed ) == true ) return;
|
if( m_exit.load( std::memory_order_relaxed ) == true ) return;
|
||||||
if( m_signalSwitch.load( std::memory_order_relaxed ) == true ) break;
|
if( m_signalSwitch.load( std::memory_order_relaxed ) == true ) break;
|
||||||
|
std::this_thread::yield();
|
||||||
}
|
}
|
||||||
m_signalSwitch.store( false, std::memory_order_relaxed );
|
m_signalSwitch.store( false, std::memory_order_relaxed );
|
||||||
std::swap( m_buf, m_second );
|
std::swap( m_buf, m_second );
|
||||||
@ -165,7 +166,7 @@ private:
|
|||||||
if( m_offset == BufSize )
|
if( m_offset == BufSize )
|
||||||
{
|
{
|
||||||
m_signalSwitch.store( true, std::memory_order_relaxed );
|
m_signalSwitch.store( true, std::memory_order_relaxed );
|
||||||
while( m_signalAvailable.load( std::memory_order_acquire ) == false ) {}
|
while( m_signalAvailable.load( std::memory_order_acquire ) == false ) { std::this_thread::yield(); }
|
||||||
m_signalAvailable.store( false, std::memory_order_relaxed );
|
m_signalAvailable.store( false, std::memory_order_relaxed );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,7 +185,7 @@ private:
|
|||||||
if( m_offset == BufSize )
|
if( m_offset == BufSize )
|
||||||
{
|
{
|
||||||
m_signalSwitch.store( true, std::memory_order_relaxed );
|
m_signalSwitch.store( true, std::memory_order_relaxed );
|
||||||
while( m_signalAvailable.load( std::memory_order_acquire ) == false ) {}
|
while( m_signalAvailable.load( std::memory_order_acquire ) == false ) { std::this_thread::yield(); }
|
||||||
m_signalAvailable.store( false, std::memory_order_relaxed );
|
m_signalAvailable.store( false, std::memory_order_relaxed );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user