From: KOSAKI Motohiro Date: 2010-07-10T10:56:54+09:00 Subject: [ruby-core:31172] Re: [Bug #2553] Fix pthreads slowness by eliminating unnecessary sigprocmask calls 2010/7/10 KOSAKI Motohiro : > 2010/7/10 Andre Nathan : >> Issue #2553 has been updated by Andre Nathan. >> >> >> Hello >> >> I was trying to update the ubuntu ruby 1.8.7 package with this patch, but I'm still seeing the bad performance. The patch has the following line: >> >> if test -n "`(/lib/libc.so.6 2>/dev/null | fgrep 'Native POSIX Threads') 2> /dev/null`"; then >> use_context=yes >> fi >> >> Isn't the use of setcontext necessary only for linuxthreads, i.e. if the system doesn't have native posix threads? In that case, shouldn't the test be "test -z", so that use_context is set to yes if "Native POSIX Threads" does *not* appear in that output? >> >> Apologies if I have misunderstood the patch. > > Oops, this patch only works on 32bit machine, because some 64bit > distro don't have /lib/libc.so.6 (instead they use /lib64), and this > condition select use_context=yes. > > I'll update this soon. > And, if you are using 32bit distro, please show your /lib/libc.so.6 > execution result. > > I'm very sorry this. following patch works both 32bit and 64bit on my environment. $ svn diff Index: configure.in =================================================================== --- configure.in (リビジョン 28594) +++ configure.in (作業コピー) @@ -1151,7 +1151,7 @@ if test x"$rb_with_pthread" = xyes; then AS_CASE("$target_cpu:$target_os:$cross_compiling", [*:linux*:no], [ - if test -n "`(/lib/libc.so.6 2>/dev/null | fgrep 'Native POSIX Threads') 2> /dev/null`"; then + if test -n "`(/lib/libc.so.6 2>/dev/null | fgrep 'linuxthreads') 2> /dev/null`"; then use_context=yes fi ],