> Note: if we use /proc/sys/kernel/sched_compat_yield=3D1, we can get bette=
r result.
>
> % taskset -c 1 =A0./ruby projects/thrprio/thrprio2.rb
> 16989126 12636726 0.14691223057483713 1.3444246555634742 true

And, if we apply following patch, tuning sched_compat_yield knob is
not necessary anymore.


diff --git a/thread_pthread.c b/thread_pthread.c
index e6295db..ddef0b3 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -130,7 +130,14 @@ native_cond_timedwait(pthread_cond_t *cond,
pthread_mutex_t *mutex, struct times

 #define native_cleanup_push pthread_cleanup_push
 #define native_cleanup_pop  pthread_cleanup_pop
-#ifdef HAVE_SCHED_YIELD
+
+#ifdef linux
+/*
+ * Linux sched_yield() have difference behavior against other OS's one.
+ * In many case, it does as NOP. We don't hope it.
+ */
+#define native_thread_yield() (usleep(0))
+#elif defined(HAVE_SCHED_YIELD)
 #define native_thread_yield() (void)sched_yield()
 #else
 #define native_thread_yield() ((void)0)