You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
voidspin_lock(structspinlock *lock)
{
// test_and_set: set flag to `1` and return old value// if the func returns 0, flag 0->1, means get the lockwhile (atomic_test_and_set(&lock->locked));
}
voidspin_lock(structspinlock *lock)
{
// `test_and_set` always write to cache line, which cause performance issue// read only op before write, reduce cache line flushwhile (!lock->locked && atomic_test_and_set(&lock->locked));
}
No description provided.
The text was updated successfully, but these errors were encountered: