Is_ruby_native_thread()

e$B<r0f$G$9!#e(B

1.8 e$B$Ne(B is_ruby_native_thread() e$B$O8=:$N%M%$%F%#%V%9%l%C%I$,e(B
Rubye$B$N%M%$%F%#%V%9%l%C%I$G$"$k$+H]$+$rJV$7$F$$$^$7$?$,!"e(B
1.9
e$B$G$O8=:
$N%M%$%F%#%V%9%l%C%I$K$h$i$:>o$Ke(BQtruee$B$rJV$7$F$$$^$9!#e(B

e$B8_49@-$N$?$a$K4X?t$@$1$O;D$7$F$"$k$N$+$bCN$l$^$;$s$,!"e(B
e$B$3$l$@$He(B is_ruby_native_thread() e$B$,;H$$J*$K$J$k$+$re(B
have_func(“is_ruby_native_thread”) e$B$GH=CG$G$-$:ITJX$J$N$G!"e(B
e$B$$$C$=$3$N4X?t$rL5$/$9$3$H$O=PMh$J$$$G$7$g$&$+e(B?

e$B$J$+$@$G$9!#e(B

At Sun, 8 Jul 2007 12:56:20 +0900,
Masahiro S. (e$B<r0f@/M5e(B) wrote in [ruby-dev:31166]:

1.8 e$B$Ne(B is_ruby_native_thread() e$B$O8=:$N%M%$%F%#%V%9%l%C%I$,e(B
Rubye$B$N%M%$%F%#%V%9%l%C%I$G$"$k$+H]$+$rJV$7$F$$$^$7$?$,!"e(B
1.9 e$B$G$O8=:
$N%M%$%F%#%V%9%l%C%I$K$h$i$:>o$Ke(BQtruee$B$rJV$7$F$$$^$9!#e(B

e$B$I$&$$$&>uBV$Ge(Btruee$B$rJV$9$N$,K>$^$7$$$s$G$7$g$&$+!#e(Bruby
threade$B$He(B
e$B4XO"$E$1$i$l$F$$$k%M%$%F%#%V%9%l%C%I$N>l9ge(B?

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

e$B$3$N$H$3$mA4$/9W8%$G$-$F$J$/$F!$$9$_$^$;$s!%e(B

From: Nobuyoshi N. [email protected]
Subject: [ruby-dev:31269] Re: is_ruby_native_thread()
Date: Sat, 21 Jul 2007 22:45:29 +0900
Message-ID: [email protected]

At Sun, 8 Jul 2007 12:56:20 +0900,
Masahiro S. (e$B<r0f@/M5e(B) wrote in [ruby-dev:31166]:

1.8 e$B$Ne(B is_ruby_native_thread() e$B$O8=:$N%M%$%F%#%V%9%l%C%I$,e(B
Rubye$B$N%M%$%F%#%V%9%l%C%I$G$"$k$+H]$+$rJV$7$F$$$^$7$?$,!"e(B
1.9 e$B$G$O8=:
$N%M%$%F%#%V%9%l%C%I$K$h$i$:>o$Ke(BQtruee$B$rJV$7$F$$$^$9!#e(B

e$B$I$&$$$&>uBV$Ge(Btruee$B$rJV$9$N$,K>$^$7$$$s$G$7$g$&$+!#e(Bruby threade$B$He(B
e$B4XO"$E$1$i$l$F$$$k%M%$%F%#%V%9%l%C%I$N>l9ge(B?

e$B7k6I$O$=$l$H$[$\F10U$K$O$J$k$N$G$O$J$$$+$H;W$$$^$9$,!$e(B
ruby e$B$Ne(B function e$B$r8F$V$3$H$,$G$-$ke(B native thread
e$B$J$i$Pe(B
true e$B$rJV$9$h$&$K$J$C$FM_$7$$$H;W$$$^$9!%e(B

e$B30It%i%$%V%i%j$K$*$$$F!$D>@\e(B ruby e$B$r8F$s$GNI$$$N$+!$e(B
e$B$=$l$H$bJLe(B native thread e$B$K0MMj$r=P$5$M$P$J$i$J$$$N$+$re(B
e$BH=CG$G$-$k$h$&$K$9$k$?$a$G$9!%e(B

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: Nobuyoshi N. [email protected]
Subject: [ruby-dev:31272] Re: is_ruby_native_thread()
Date: Mon, 23 Jul 2007 01:48:29 +0900
Message-ID: [email protected]

GCe$B$,5/$-$k2DG=@-$r9M$($l$P!“%9%?%C%/$,e(Bruby threade$B$G4IM}$5$l$F$$e(B
e$B$kI,MW$,$”$j$^$9!#:#$N$H$3$m!“JL$N$H$3$m$G:n$C$?e(Bnative threade$B$re(B
ruby threade$B$K4XO”$E$1$kJ}K!$ODs6!$5$l$F$$$J$$$N$G!"e(Brubye$B$G:n$i$le(B
e$B$?e(Bthreade$B8BDj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JL>A0$K$J$k$H$$$$$J$!!"$H$O;W$$$^$9!#8_49@-$NE@$+$iFq$7$$$+$J!#e(B

e$B$J$+$@$G$9!#e(B

At Sun, 22 Jul 2007 23:09:04 +0900,
Hidetoshi NAGAI wrote in [ruby-dev:31270]:

1.8 e$B$Ne(B is_ruby_native_thread() e$B$O8=:$N%M%$%F%#%V%9%l%C%I$,e(B
Rubye$B$N%M%$%F%#%V%9%l%C%I$G$"$k$+H]$+$rJV$7$F$$$^$7$?$,!"e(B
1.9 e$B$G$O8=:
$N%M%$%F%#%V%9%l%C%I$K$h$i$:>o$Ke(BQtruee$B$rJV$7$F$$$^$9!#e(B

e$B$I$&$$$&>uBV$Ge(Btruee$B$rJV$9$N$,K>$^$7$$$s$G$7$g$&$+!#e(Bruby threade$B$He(B
e$B4XO"$E$1$i$l$F$$$k%M%$%F%#%V%9%l%C%I$N>l9ge(B?

e$B7k6I$O$=$l$H$[$\F10U$K$O$J$k$N$G$O$J$$$+$H;W$$$^$9$,!$e(B
ruby e$B$Ne(B function e$B$r8F$V$3$H$,$G$-$ke(B native thread e$B$J$i$Pe(B
true e$B$rJV$9$h$&$K$J$C$FM_$7$$$H;W$$$^$9!%e(B

GCe$B$,5/$-$k2DG=@-$r9M$($l$P!"%9%?%C%/$,e(Bruby
threade$B$G4IM}$5$l$F$$e(B
e$B$kI,MW$,$"$j$^$9!#:#$N$H$3$m!“JL$N$H$3$m$G:n$C$?e(Bnative
threade$B$re(B
ruby
threade$B$K4XO”$E$1$kJ}K!$ODs6!$5$l$F$$$J$$$N$G!"e(Brubye$B$G:n$i$le(B
e$B$?e(Bthreade$B8BDj$G$9$M!#e(B

(1) e$B%9%l%C%I8GM-%G!<%?$K$J$K$+J]B8$7$F$*$/e(B
(2) ruby threade$B$+$i0lCW$9$k$b$N$rC5$9e(B
e$B$"$?$j$+$J!#e(B

e$B$J$+$@$G$9!#e(B

At Mon, 23 Jul 2007 11:09:41 +0900,
Hidetoshi NAGAI wrote in [ruby-dev:31274]:

(1) e$B%9%l%C%I8GM-%G!<%?$K$J$K$+J]B8$7$F$*$/e(B
(2) ruby threade$B$+$i0lCW$9$k$b$N$rC5$9e(B
e$B$"$?$j$+$J!#e(B

e$B$3$&$7$?e(B call e$B$G;~4V$,$+$+$k$N$O4r$7$/$J$5$=$&$J$N$G!$e(B
e$B$G$-$l$Pe(B (1) e$B$NJ}$+$J$!!%!%!%e(B
e$B$G$b$=$N>l9g!$2?$+$&$^$$;XLf$r9M$($J$$$He(B
e$B!V$?$^$?$^!W$C$F$3$H$b@8$8$k$G$7$g$&$+!)e(B

pthreade$B$J$ie(Bpthread_key_createe$B!“e(Bwin32e$B$J$ie(BTlsAlloce$B$G:n$i$l$k%-!<e(B
e$B$Oe(B(e$BGK4~$7$J$$8B$je(B?)e$BKh2s0[$J$k$O$:$J$N$G!”$=$&$$$&?4G[$O$J$$$G$7$ge(B
e$B$&!#$H$$$&$+=EJ#$,$"$j$($k$J$s$F$N$O;H$$$b$N$K$J$j$^$;$s!#e(B

e$B;H$C$F$k4V$Ke(BTlsFreee$B$5$l$k$H$I$&$J$k$s$@$m$&!#e(B

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: Nobuyoshi N. [email protected]
Subject: [ruby-dev:31277] Re: is_ruby_native_thread()
Date: Mon, 23 Jul 2007 13:29:24 +0900
Message-ID: [email protected]

pthreade$B$J$ie(Bpthread_key_createe$B!“e(Bwin32e$B$J$ie(BTlsAlloce$B$G:n$i$l$k%-!<e(B
e$B$Oe(B(e$BGK4~$7$J$$8B$je(B?)e$BKh2s0[$J$k$O$:$J$N$G!”$=$&$$$&?4G[$O$J$$$G$7$ge(B
e$B$&!#$H$$$&$+=EJ#$,$"$j$($k$J$s$F$N$O;H$$$b$N$K$J$j$^$;$s!#e(B

e$B;d$,$o$+$C$F$J$$$@$1$H$$$&5$$,$7$J$$$G$b$J$$$G$9$,e(B (^_^; e$B!$e(B
e$B%9%l%C%I8GM-%G!<%?$H$7$FJ];}$5$;$?$H$-$N%P%$%J%j%Q%?!<%s$,e(B
ruby e$B$rA[Dj$7$F$$$J$$e(B native thread
e$B$,J]4I$7$?%9%l%C%I8GM-%G!<%?$Ne(B
e$B%P%$%J%j%Q%?!<%s$H$?$^$?$^0lCW$9$k$3$H$O$"$j$($J$$$N$+$H$$$&OC$G$9!%e(B

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: SASADA Koichi [email protected]
Subject: [ruby-dev:31275] Re: is_ruby_native_thread()
Date: Mon, 23 Jul 2007 11:20:40 +0900
Message-ID: [email protected]

e$B!!e(B(1) e$B$KM-8z$JJ}K!$,;W$$$D$+$J$$$N$G!"e(B(2) e$B$7$+L5$$$s$8$c$J$$$+e(B
e$B$J$!!#e(B

e$B!!%0%m!<%P%kJQ?t$Ke(B linked list e$B$+e(B hash e$B$X$N%]%$%s%?$r2C$($F$“e(B
e$B$2$F!”%"%/%;%9$OI,$:GSB>@)8f$9$k46$8$N$b$N$,!#e(B

e$B!!@-G=$K1F6A$,=P$k$[$IMxMQIQEY$O9b$$$G$9$+!)e(B

e$B0l$D$O!$30It%i%$%V%i%j$,$=$NFbIt%k!<%A%s$Ge(B native thread e$B$re(B
e$B@8@.$9$k2DG=@-$,$“$k%1!<%9$G$9!%e(B
ruby e$B$X$Ne(B call e$B$,0l@ZL5$$$3$H$,J]>Z$5$l$k$J$i$$$$$N$G$9$,!$e(B
e$B$=$&$G$J$$>l9g$K$OKh2s$N%A%'%C%/$rI,MW$H$9$k2DG=@-$,$”$j$^$9!%e(B

e$B$“$k8GDj%9%l%C%I$KI,$:e(B ruby
e$B8F$S=P$7=hM}$r0MMj$9$k$H$$$&J}K!$be(B
e$B$b$A$m$s$”$j$^$9$,!$8zN($r9M$($k$H!$D>@\8F$Y$k8B$j$OD>@\8F$S$?$$$He(B
e$B9M$($k$N$,?M>p$G$9$h$M!%e(B

e$B$?$@!$!VKhEY$N%9%l%C%I@Z$jBX$($KHf$Y$l$P7Z$$$+$ie(B (2)
e$B$G$$$$$8$c$s!We(B
e$B$C$F<gD%$b$"$j$=$&$G$9$M!%e(B

e$B$b$&0l$D$O!$3d$j9~$=hM}$G$9!%e(B
e$B3d$j9~$
=hM}$re(B ruby e$B$GEPO?$7$F$$$k>l9g!$e(B
e$B3d$j9~$$r<u$1IU$1$?e(B native thread e$B$,e(B ruby
e$B$r8F$Y$k$+$I$&$+$re(B
e$B%A%'%C%/$9$kI,MW$,$"$j$^$9$h$M!)e(B
e$B3d$j9~$
=hM}$O>/$7$G$bAa$/$K40N;$5$;$k$Y$-$G$9$N$G!$e(B
e$B%A%'%C%/$b$o$:$+$G$bAa$$$K1[$7$?$3$H$O$J$$$O$:$G$9!%e(B

e$B8=:_$Ne(B 1.9 e$B$Ne(B signal.c

e$B$G$OLdBj$J$7$H$$$&$3$H$G$"$l$P$4$a$s$J$5$$!%e(B

e$B!!$“$H!“e(Bis_* e$B$H$$$&L>A0$O$”$l$J$N$G!”=PMh$l$Pe(B rb_ e$B$,$D$$$?%J%$e(B
e$B%9$JL>A0$K$J$k$H$$$$$J$!!"$H$O;W$$$^$9!#8_49@-$NE@$+$iFq$7$$$+$J!#e(B

e$B$3$l$OJQ99$7$A$c$C$F$b$$$$$H;W$$$^$9!%e(B
is_ruby_native_thread()
e$B$G$N%A%'%C%/$rI,MW$H$9$k$h$&$J%i%$%V%i%j$O!$e(B
1.9
e$BBP1~$N$?$a$K$O!$B?J,!$$=$l$J$j$NNL$N=q$-D>$7$rI,MW$H$9$k$G$7$g$&$+$i!%e(B

On Mon, 23 Jul 2007 13:45:59 +0900
In article [email protected]
[[ruby-dev:31278] Re: is_ruby_native_thread()]
Hidetoshi NAGAI [email protected] wrote:

pthreade$B$J$ie(Bpthread_key_createe$B!“e(Bwin32e$B$J$ie(BTlsAlloce$B$G:n$i$l$k%-!<e(B
e$B$Oe(B(e$BGK4~$7$J$$8B$je(B?)e$BKh2s0[$J$k$O$:$J$N$G!”$=$&$$$&?4G[$O$J$$$G$7$ge(B
e$B$&!#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$B$G$9$+e(B?

e$B!!$"$H!“e(Bis_* e$B$H$$$&L>A0$O$”$l$J$N$G!"=PMh$l$Pe(B rb_ e$B$,$D$$$?%J%$e(B
e$B%9$JL>A0$K$J$k$H$$$$$J$!!"$H$O;W$$$^$9!#8_49@-$NE@$+$iFq$7$$$+$J!#e(B

e$B$3$l$OJQ99$7$A$c$C$F$b$$$$$H;W$$$^$9!%e(B
is_ruby_native_thread() e$B$G$N%A%’%C%/$rI,MW$H$9$k$h$&$J%i%$%V%i%j$O!$e(B
1.9 e$BBP1~$N$?$a$K$O!$B?J,!$$=$l$J$j$NNL$N=q$-D>$7$rI,MW$H$9$k$G$7$g$&$+$i!%e(B

e$B$J$K$,$$$$$G$9$+$M$’!#e(B

Index: thread.c

— thread.c (revision 12839)
+++ thread.c (working copy)
@@ -2966,4 +2966,4 @@ int
is_ruby_native_thread(void)
{

  • return Qtrue;
  • return ruby_thread_from_native() ? Qtrue : Qfalse;
    }
    Index: thread_pthread.ci
    ===================================================================
    — thread_pthread.ci (revision 12839)
    +++ thread_pthread.ci (working copy)
    @@ -73,4 +73,6 @@ static void remove_signal_thread_list(rb
    static rb_thread_lock_t signal_thread_list_lock;

+static pthread_key_t ruby_native_thread_key;
+
static void
null_func()
@@ -80,11 +82,28 @@ null_func()

static void
-Init_native_thread()
+init_ruby_nathive_thread_key(void)
+{

  • pthread_key_create(&ruby_native_thread_key, NULL);
    +}

+static void
+Init_native_thread(void)
{

  • GET_THREAD()->thread_id = pthread_self();
  • pthread_once_t key_once = PTHREAD_ONCE_INIT;
  • rb_thread_t *th = GET_THREAD();
  • pthread_once(&key_once, init_ruby_nathive_thread_key);
  • th->thread_id = pthread_self();
  • pthread_setspecific(ruby_native_thread_key, th);
    native_mutex_initialize(&signal_thread_list_lock);
    posix_signal(SIGVTALRM, null_func);
    }

+static rb_thread_t *
+ruby_thread_from_native(void)
+{

  • return pthread_getspecific(ruby_native_thread_key);
    +}

static void
native_thread_destroy(rb_thread_t *th)
Index: thread_win32.ci

— thread_win32.ci (revision 12839)
+++ thread_win32.ci (working copy)
@@ -21,8 +21,24 @@
#define remove_signal_thread_list(th)

+static volatile DWORD ruby_native_thread_key = TLS_OUT_OF_INDEXES;
+
static void
Init_native_thread()
{

  • static LONG wait_flag = -1;
    rb_thread_t *th = GET_THREAD();
  • while (ruby_native_thread_key == TLS_OUT_OF_INDEXES) {
  • if (InterlockedIncrement(&wait_flag) > 0) {
  •  InterlockedDecrement(&wait_flag);
    
  •  Sleep(1);
    
  • }
  • else {
  •  ruby_native_thread_key = TlsAlloc();
    
  •  InterlockedDecrement(&wait_flag);
    
  •  break;
    
  • }
  • }
  • TlsSetValue(ruby_native_thread_key, th);
    DuplicateHandle(GetCurrentProcess(),
    GetCurrentThread(),
    @@ -37,4 +53,10 @@ Init_native_thread()
    }

+static rb_thread_t *
+ruby_thread_from_native(void)
+{

  • return TlsGetValue(ruby_native_thread_key);
    +}

static void
w32_error(void)

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: Tietew [email protected]
Subject: [ruby-dev:31279] Re: is_ruby_native_thread()
Date: Mon, 23 Jul 2007 15:39:00 +0900
Message-ID: [email protected]

TlsAlloce$B$H$+e(Bpthread_key_createe$B$H$$$&$N$O!“!V26!J$3$N>l9ge(BRubye$B%$%se(B
e$B%?%W%j%?!K@lMQ$Ne(BTLSe$BNN0h$N%-!<!J%$%s%G%/%9!K$r3d$jEv$F$F$/$l!W$Ce(B
e$B$F$$$&4X?t$J$N$G!”?4G[MW$j$^$;$s!#e(B

e$B$"$j$,$H$&$4$6$$$^$9!%e(B

e$B30It%i%$%V%i%j$,@8@.$7$?%9%l%C%I8GM-%G!<%?$H$O%-!<$,0[$J$k$N$G!$e(B
ruby e$B$G$N%A%'%C%/$N$?$a$N;2>H$K1F6A$9$k$3$H$O$J$$$7!$e(B
e$B2>$Ke(B ruby e$B$N$?$a$N%-!<>pJs$,0z$-7Q$,$l$?$H$7$F$be(B
pthread_getspecific e$B$Oe(B EINVAL e$B$N%(%i!<%3!<%I$rJV$9$@$1$Ge(B
e$BLdBj$J$7$H$$$&$3$H$G$9$M!%e(B

e$B<r0f$G$9!#e(B

From: Hidetoshi NAGAI [email protected]
Date: Sun, 22 Jul 2007 23:09:04 +0900

1.8 e$B$Ne(B is_ruby_native_thread() e$B$O8=:$N%M%$%F%#%V%9%l%C%I$,e(B
Rubye$B$N%M%$%F%#%V%9%l%C%I$G$"$k$+H]$+$rJV$7$F$$$^$7$?$,!"e(B
1.9 e$B$G$O8=:
$N%M%$%F%#%V%9%l%C%I$K$h$i$:>o$Ke(BQtruee$B$rJV$7$F$$$^$9!#e(B

e$B$I$&$$$&>uBV$Ge(Btruee$B$rJV$9$N$,K>$^$7$$$s$G$7$g$&$+!#e(Bruby threade$B$He(B
e$B4XO"$E$1$i$l$F$$$k%M%$%F%#%V%9%l%C%I$N>l9ge(B?

e$B$=$NDL$j$@$H;W$$$^$9!#e(Bis_ruby_native_thread()
e$B$r;D$9$N$J$i$G$9$,!#e(B

e$B7k6I$O$=$l$H$[$\F10U$K$O$J$k$N$G$O$J$$$+$H;W$$$^$9$,!$e(B
ruby e$B$Ne(B function e$B$r8F$V$3$H$,$G$-$ke(B native thread e$B$J$i$Pe(B
true e$B$rJV$9$h$&$K$J$C$FM_$7$$$H;W$$$^$9!%e(B

e$B30It%i%$%V%i%j$K$*$$$F!$D>@\e(B ruby e$B$r8F$s$GNI$$$N$+!$e(B
e$B$=$l$H$bJLe(B native thread e$B$K0MMj$r=P$5$M$P$J$i$J$$$N$+$re(B
e$BH=CG$G$-$k$h$&$K$9$k$?$a$G$9!%e(B

e$B$=$NL\E*$K$Oe(B ruby thread
e$B$H4XO"IU$1$i$l$F$$$k$@$1$G$OIT==J,$G!“e(B
GVL (Global VM Lock) e$B$rJ];}$7$F$$$k$3$H$b3NG’$9$kI,MW$,$”$j$^$9!#e(B
GVL e$B$Oe(B rb_thread_blocking_region()
e$B$G<jJ|$9$3$H$,=PMh$k$N$G!#e(B

e$B$J$+$@$G$9!#e(B

At Mon, 23 Jul 2007 19:01:55 +0900,
Hidetoshi NAGAI wrote in [ruby-dev:31284]:

e$B0l$D$O!$30It%i%$%V%i%j$,$=$NFbIt%k!<%A%s$Ge(B native thread e$B$re(B
e$B@8@.$9$k2DG=@-$,$"$k%1!<%9$G$9!%e(B
ruby e$B$X$Ne(B call e$B$,0l@ZL5$$$3$H$,J]>Z$5$l$k$J$i$$$$$N$G$9$,!$e(B
e$B$=$&$G$J$$>l9g$K$OKh2s$N%A%’%C%/$rI,MW$H$9$k2DG=@-$,$"$j$^$9!%e(B

native threade$B$+$ie(Bruby threade$B$K7k$S$D$1$kJ}K!$,$"$C$?$[$&$,$$$$e(B
e$B$G$9$+e(B?

e$B$3$l$,I,MW$+$I$&$+$O!$$^$@M}2r$G$-$F$$$J$$$s$G$9$,!$e(B
e$BC1$Ke(B ruby e$B$r8F$V$@$1$J$i$=$N7k$SIU$1$rD4$Y$kI,MW$^$G$O$J$$$s$G$9$h$M!)e(B

e$B!VC1$Ke(B ruby
e$B$r8F$V!W$H$$$&$N$,e(Bruby_run_nodee$B$r8F$V$H$$$&$3$H$J$i!"e(B
e$BI,MW$J$$$G$9!#e(Brubye$B$,:n$C$?e(Bthreade$B0J30$+$ie(Brubye$B$N%k!<%A%s$r8F$V>le(B
e$B9g$OI,?$K$J$k$H;W$$$^$9!#$G$J$$$He(BGCe$B$G$-$^$;$s$+$i!#e(B

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: Nobuyoshi N. [email protected]
Subject: [ruby-dev:31280] Re: is_ruby_native_thread()
Date: Mon, 23 Jul 2007 17:15:25 +0900
Message-ID: [email protected]

At Mon, 23 Jul 2007 12:54:43 +0900,
Hidetoshi NAGAI wrote in [ruby-dev:31276]:

e$B0l$D$O!$30It%i%$%V%i%j$,$=$NFbIt%k!<%A%s$Ge(B native thread e$B$re(B
e$B@8@.$9$k2DG=@-$,$“$k%1!<%9$G$9!%e(B
ruby e$B$X$Ne(B call e$B$,0l@ZL5$$$3$H$,J]>Z$5$l$k$J$i$$$$$N$G$9$,!$e(B
e$B$=$&$G$J$$>l9g$K$OKh2s$N%A%'%C%/$rI,MW$H$9$k2DG=@-$,$”$j$^$9!%e(B

native threade$B$+$ie(Bruby threade$B$K7k$S$D$1$kJ}K!$,$"$C$?$[$&$,$$$$e(B
e$B$G$9$+e(B?

e$B$3$l$,I,MW$+$I$&$+$O!$$^$@M}2r$G$-$F$$$J$$$s$G$9$,!$e(B
e$BC1$Ke(B ruby
e$B$r8F$V$@$1$J$i$=$N7k$SIU$1$rD4$Y$kI,MW$^$G$O$J$$$s$G$9$h$M!)e(B

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B

From: Nobuyoshi N. [email protected]
Subject: [ruby-dev:31286] Re: is_ruby_native_thread()
Date: Tue, 24 Jul 2007 02:09:21 +0900
Message-ID: [email protected]

e$B!VC1$Ke(B ruby e$B$r8F$V!W$H$$$&$N$,e(Bruby_run_nodee$B$r8F$V$H$$$&$3$H$J$i!"e(B
e$BI,MW$J$$$G$9!#e(Brubye$B$,:n$C$?e(Bthreade$B0J30$+$ie(Brubye$B$N%k!<%A%s$r8F$V>le(B
e$B9g$OI,?$K$J$k$H;W$$$^$9!#$G$J$$$He(BGCe$B$G$-$^$;$s$+$i!#e(B

e$B$“!$$=$&$$$&0UL#$G$9$+!%e(B
e$B0JA0!$$5$5$@$5$s$K!V30It%i%$%V%i%j$,@8@.$7$?e(B native thread
e$B$+$ie(B ruby e$B$r8F$S=P$;$k$h$&$K$G$-$k$+!W$H?R$M$?$H$-$Ke(B
e$B!V%@%a!W$H8@$o$l$?5-21$,$”$C$?$s$G!$0c$&0UL#$K<h$C$F$^$7$?!%e(B

thread ID e$B$+$ie(B thread

e$B%*%V%8%'%/%H$r@8@.$9$kN`$$$NOC$+$H!%e(B(^_^;

ruby e$B$N%k!<%A%s$r8F$S=P$;$k$h$&$K4{B8$Ne(B native thread e$B$Ke(B
e$B2?$i$+$N=i4|2=$r9T$&$H$$$&$N$G$“$l$P!$3N$+$K4r$7$$%1!<%9$,e(B
e$B$”$j$=$&$K;W$($^$9!%e(B
ruby e$B$Ne(B thread e$B$^$?$O=i4|2=:Q$_e(B native thread
e$B$G$"$k>l9g$K$Oe(B
e$BC1$K%(%i!<$J$7$K=*N;$9$k$H$$$&$h$&$K$J$C$F$$$l$P!$e(B
is_ruby_native_thread() e$B$r;H$C$F$$$k$+$J$j$NItJ,$re(B
e$B$9$C$-$j$HCV$-49$($k$3$H$,$G$-$=$&$G$9$M!%e(B