SPU: improve TSX usage
Reduce transaction failure amount Remove vm::try_to_lock
This commit is contained in:
@@ -100,6 +100,11 @@ public:
|
||||
{
|
||||
return (m_value.load() % c_one) != 0;
|
||||
}
|
||||
|
||||
bool is_lockable() const
|
||||
{
|
||||
return m_value.load() >= c_min;
|
||||
}
|
||||
};
|
||||
|
||||
// Simplified shared (reader) lock implementation.
|
||||
|
||||
+3
-2
@@ -992,9 +992,10 @@ constexpr FORCE_INLINE error_code::not_an_error not_an_error(const T& value)
|
||||
}
|
||||
|
||||
// Synchronization helper (cache-friendly busy waiting)
|
||||
inline void busy_wait(std::size_t count = 100)
|
||||
inline void busy_wait(std::size_t cycles = 3000)
|
||||
{
|
||||
while (count--) _mm_pause();
|
||||
const u64 s = __rdtsc();
|
||||
do _mm_pause(); while (__rdtsc() - s < cycles);
|
||||
}
|
||||
|
||||
// Rotate helpers
|
||||
|
||||
Reference in New Issue
Block a user