• Manfred Spraul's avatar
    [PATCH] reorder 'rep;nop;' in the spinlock macro · 5e163a89
    Manfred Spraul authored
    According to Intel's recommendation, 'rep;nop; should be called before
    testing if the lock variable was modified (i.e. rep nop;cmp;jcc). The
    current implementation does it the wrong way around: first test, then
    wait, then branch. I've asked Asit Mallik from Intel, and he recommended
    to change it.
    
    It should be at least consistent: Right now, spinlock uses
    'cmp;rep nop;jcc', rwlock uses 'rep nop;cmp;jcc'
    5e163a89
spinlock.h 4.38 KB