1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Keep atomics on separate cache lines.

This commit is contained in:
Bartosz Taudul 2019-12-31 14:46:01 +01:00
parent ede90710e5
commit 8b56386ccd
2 changed files with 4 additions and 4 deletions

View File

@ -266,9 +266,9 @@ private:
size_t m_offset;
size_t m_lastBlock;
std::atomic<bool> m_signalSwitch;
std::atomic<bool> m_signalAvailable;
std::atomic<bool> m_exit;
alignas(64) std::atomic<bool> m_signalSwitch;
alignas(64) std::atomic<bool> m_signalAvailable;
alignas(64) std::atomic<bool> m_exit;
std::thread m_decThread;

View File

@ -1349,7 +1349,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
size_t bufsz = 0;
char* outbuf = nullptr;
size_t outsz = 0;
std::atomic<State> state = Available;
alignas(64) std::atomic<State> state = Available;
};
// Leave one thread for file reader, second thread for dispatch (this thread)