Replace sched_yield with usleep(1) on Linux
to avoid the massive overhead of the sched_yield call on Linux kernels since its semantics were changed in early 2003 (late 2.5 series) to include reordering of the thread queue. Ref. #900,#923
This commit is contained in:
parent
c61a7cd293
commit
f1db56fcd7
4
common.h
4
common.h
|
@ -314,6 +314,10 @@ typedef int blasint;
|
||||||
#define YIELDING thr_yield()
|
#define YIELDING thr_yield()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(OS_LINUX)
|
||||||
|
#define YIELDING usleep(1)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(OS_WINDOWS)
|
#if defined(OS_WINDOWS)
|
||||||
#if defined(_MSC_VER) && !defined(__clang__)
|
#if defined(_MSC_VER) && !defined(__clang__)
|
||||||
#define YIELDING YieldProcessor()
|
#define YIELDING YieldProcessor()
|
||||||
|
|
Loading…
Reference in New Issue