What does __asm volatile (“pause” ::: “memory”); do?
问题 I am looking at an open source C++ project which has the following code structure: while(true) { // Do something work if(some_condition_becomes_true) break; __asm volatile ("pause" ::: "memory"); } What does the last statement do? I understand that __asm means that it is an assembly instruction and I found some posts about pause instruction which say that the thread effectively hints the core to release resources and give other thread more resources (in context of hyper-threading). But what