What is the purpose of the “PAUSE” instruction in x86?
Just imagine, how the processor would execute a typical spin-wait loop: 1 Spin_Lock: 2 CMP lockvar, 0 ; Check if lock is free 3 JE Get_Lock 4 JMP Spin_Lock 5 Get_Lock: After a few iterations the branch predictor will predict that the conditional branch (3) will never be taken and the pipeline will fill with … Read more