Use cpu_relax() implementation for aarch64 (#11677)
Motivation: We only implement cpu_relax() for x86_64 atm, we should also do for aarch64 Modifications: Add implementation Result: Possible better performance on aarch64 when busy spinning with epoll is used
This commit is contained in:
parent
1eb128e2a9
commit
a76842dcd5
@ -287,6 +287,8 @@ static jint netty_epoll_native_epollWait0(JNIEnv* env, jclass clazz, jint efd, j
|
|||||||
static inline void cpu_relax() {
|
static inline void cpu_relax() {
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
asm volatile("pause\n": : :"memory");
|
asm volatile("pause\n": : :"memory");
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
asm volatile("isb\n": : :"memory");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user