ruby-changes:53619
From: samuel <ko1@a...>
Date: Tue, 20 Nov 2018 18:59:19 +0900 (JST)
Subject: [ruby-changes:53619] samuel:r65835 (trunk): Better support for amd64 platforms
samuel 2018-11-20 18:59:14 +0900 (Tue, 20 Nov 2018) New Revision: 65835 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65835 Log: Better support for amd64 platforms Modified files: trunk/configure.ac trunk/cont.c Index: configure.ac =================================================================== --- configure.ac (revision 65834) +++ configure.ac (revision 65835) @@ -2274,12 +2274,6 @@ AS_IF([test x"$target_cpu" = xia64], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L2274 ]) ]) -AS_CASE(["$target_cpu-$target_os"], - [*-darwin*], [ - AC_LIBOBJ([coroutine/amd64/Context]) - ], -) - AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign, [AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [(-1==(-1>>1))])], rb_cv_rshift_sign=yes, @@ -2331,6 +2325,18 @@ AS_IF([test "${universal_binary-no}" = y https://github.com/ruby/ruby/blob/trunk/configure.ac#L2325 AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $dir) ]) +AC_MSG_CHECKING(native fiber implementation) +AS_CASE(["$target_cpu-$target_os"], + [x*64-*], [ + AC_MSG_RESULT(amd64) + AC_DEFINE(FIBER_USE_COROUTINE, "coroutine/amd64/Context.h") + AC_LIBOBJ([coroutine/amd64/Context]) + ], + [*], [ + AC_MSG_RESULT(no) + ] +) + AS_IF([test x"$enable_pthread" = xyes], [ for pthread_lib in thr pthread pthreads c c_r root; do AC_CHECK_LIB($pthread_lib, pthread_create, Index: cont.c =================================================================== --- cont.c (revision 65834) +++ cont.c (revision 65835) @@ -29,6 +29,8 @@ https://github.com/ruby/ruby/blob/trunk/cont.c#L29 /* Enable this include to make fiber yield/resume about twice as fast. + rvm install ruby-head-ioquatix-native-fiber --url https://github.com/ioquatix/ruby --branch native-fiber + # Without libcoro koyoko% ./build/bin/ruby ./fiber_benchmark.rb 10000 1000 setup time for 10000 fibers: 0.099961 @@ -40,10 +42,8 @@ https://github.com/ruby/ruby/blob/trunk/cont.c#L42 execution time for 1000 messages: 8.491746 */ -#define FIBER_USE_COROUTINE - #ifdef FIBER_USE_COROUTINE -#include "coroutine/amd64/Context.h" +#include FIBER_USE_COROUTINE #define FIBER_USE_NATIVE 1 #endif -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/