MVM interface draft

[email protected]$G$9!#e(B

[email protected]!9=5$K$J$j$^$9$,!"[email protected]$5$s$H$$$m$$$mOC$79g$$$7$F$-$^$7$?!#$=e(B
e$B$N$&$A!"e(BMVMe$B$Ne(BCe$B%$%s%?!<%U%’!<%9$KIU$$$F$N7o$G$9!#e(B

e$B$^[email protected]$l$J$I$"$k$+$b$7$l$^$;$s$,!"$H$j$"$($:!#e(B

= VM C APIe$B0Fe(B

== e$BMQ8le(B
e$B$H$j$"$($:0J2<$NMQ8l$r;H$&$3$H$K$7$^$9!#e(B

— e$B%(%s%8%se(B
e$B%I%i%$%P$+$i8F$S=P$5$l$F!“e(Brubye$B$N=hM}$r9T$J$&%i%$%V%i%j!#e(B
— e$B%I%i%$%Pe(B
e$B%(%s%8%s$rMxMQ$9$k%”%W%j%1!<%7%g%s!#e(B
rubye$B%3%^%s%I!"e(Berubye$B%3%^%s%I!"e(Bmod_rubye$B$J$I!#e(B

== e$B=i4|2=e(B/e$B<B9Te(B

e$B=i4|2==hM}$O!"%W%m%;%9A4BN$KBP$9$k$b$N$H!"e(BVMe$BC10L$KBP$9$k$b$N$KJ,e(B
e$B$1$i$l$^$9!#A0<T$O!“0l%W%m%;%[email protected]$1!”%a%$%s%M%$%G%#%V%9%l%Ce(B
e$B%I$G8F$S=P$5$J$1$l$P$J$j$^$;$s!#e(B

=== e$B%W%m%;%9=i4|2=e(B
— ruby_sysinit(int **argc, char ***argv)
e$B%7%9%F%`$4$H$KI,MW$J=i4|2=$r9T$J$&!#e(B

— RUBY_INIT_STACK
e$B%a%$%s%M%$%G%#%V%9%l%C%I$N%9%?%C%/>pJs$rJ]B8$9$k!#e(B

=== VMe$B=i4|2=e(B
— ruby_vm_new(void)
e$B?7$7$$e(BVMe$B$r:[email protected]$9$k!#e(Bruby_init()e$B$O!"?7$7$$e(BVMe$B$r:[email protected]$7$?8e!"$=e(B
e$B$N>e$N%a%$%se(Brubye$B%9%l%C%I$bF1;~$K:[email protected]$9$k!#e(B

— ruby_vm_parse_option(rb_vm_t vm, int argc, const char argv)
e$B%3%^%s%I%i%$%s%
%W%7%g%s$r%Q!<%9$7$F!"7k2L$re(Bvme$BFb$KJ]B8$9$k!#e(B
-ee$B%
%W%7%g%s$^$?$O%9%/%j%W%H$r%3%s%Q%$%k$7$F!"%a%$%s%9%l%C%Ie(B
e$B$,:G=i$K<B9T$9$k%3!<%I$H$7$FJ]B8$9$k!#e(B

=== VMe$B<B9Te(B
— ruby_vm_run(rb_vm_t *vm)
VMe$B$N<B9T$r3+;O$9$k!#e(B
exit statuse$B$rJV$9!#e(B

== [email protected]$=$NB>e(B

ruby_vm_parse_option()e$B$Oe(Brubye$B%3%^%s%I$N;EMM$K$"$o$;$F$$$k$?$a!"B>e(B
e$B$N%I%i%$%P$NL\E*$K$O9g$&$H$O8B$j$^$;$s!#$=$N$h$&$J>l9g!"e(BVMe$B$N:[email protected](B
e$B$H<B9T$N4V$K!"I,MW$J%Q%i%a!<%?$r%;%C%H$9$k$3$H$K$J$j$^$9!#e(B

— ruby_vm_get_argv(VALUE vm)
vme$B$KJ]B8$5$l$?e(BARGVe$B$r<h$j=P$9!#e(B

— ruby_vm_set_argv(VALUE vm, int argc, VALUE *argv)
vme$B$G;HMQ$5$l$ke([email protected]_Dj$9$k!#e(B

— ruby_vm_init_env(VALUE vm, char **envp)
vme$B$G;[email protected]_Dj$9$k!#e(B

— ruby_vm_getenv(VALUE vm, const char *name)
vme$BCf$N4D6-JQ?t$r<h$j=P$9!#e(B

— ruby_vm_setenv(VALUE vm, const char *name, const char *value)
[email protected]_Dj$9$k!#e(B

— ruby_vm_get_pwd(VALUE vm)
vme$B$N%+%l%s%H%G%#%l%/%H%j$r<h$j=P$9!#e(B

— ruby_vm_set_pwd(VALUE vm, const char *pwd)
vme$B$N%+%l%s%H%G%#%l%/%H%[email protected]_Dj$9$k!#e(B

== ObjectSpace

e$B3Fe(BVMe$B$,%M%$%F%#%V%9%l%C%I$GJB9TF0:n$G$-$k$h$&$K$9$k$?$a!"$=$l$>$le(B
e$BFHN)$7$?e(BObjectSpacee$B$r;}$A$^$9!#7k2L$H$7$F!"$"$ke(BVMe$B$G:n$i$l$?%*%Ve(B
e$B%8%’%/%H$rJL$Ne(BVMe$B$KEO$9$3$H$O$G$-$^$;$s!#e(B

== e$B%M%$%F%#%V%9%l%C%I%$%s%?!<%U%’!<%9e(B

rubye$B0J30$G:[email protected]$5$l$?%M%$%F%#%V%9%l%C%I$+$i%(%s%8%s$r<B9T$9$k$?$ae(B
e$B$K$O!"$=$N%9%l%C%I$,e(Bruby
VMe$B$N$$$:$l$+$KEPO?$5$l$F$$$kI,MW$,$"$je(B
e$B$^$9!#0l$D$N%9%l%C%I$rJ#?t$Ne(BVMe$B$KEPO?$9$k$3$H$b2DG=$G$9$,!"F1;~$Ke(B
e$B<B9T$G$-$k$N$O0l$D$Ne(BV[email protected]$1$G$9!#J#?te(BVMe$B>e$GF1;~$KF0:n$9$k$3$H$O$Ge(B
e$B$-$^$;$s!#e(B

e$B$^$?!“F1$8%M%$%F%#%V%9%l%C%I>e$G$”$C$F$b!"0[$J$ke(BVMe$B$N%*%V%8%’%/%He(B
e$B$r:.$<$F;HMQ$9$k$3$H$b$G$-$^$;$s!#e(B

— ruby_vm_register_thread(VALUE vm)
e$B%M%$%F%#%V%9%l%C%I$KBP1~$9$ke(BThreade$B%$%s%9%?%s%9$r:[email protected]$7$F!"e(BVMe$B$KEPO?$9$k!#e(B

— ruby_vm_release_thread(VALUE vm)
Threade$B%$%s%9%?%s%9$+$i%M%$%F%#%V%9%l%C%I$r2rJ|$9$k!#e(B

— ruby_vm_enter_thread(VALUE vm)
rubye$B%9%l%C%I$H$7$F$NF0:n$r3+;O$9$k!#e(B

— ruby_vm_leave_thread(VALUE vm)
rubye$B%9%l%C%I$H$7$F$NF0:n$r=*N;$9$k!#e(B

e$BL>A0$OL$Dj$G$9$,!“e(Bruby_vm_enter_thread()e$B$7$?>uBV$G%3!<%k%P%C%/$re(B
e$B8F$S=P$7$F!”=*N;8e$Ke(Bruby_vm_leave_thread()e$B$r<B9T$9$k$b$N$bM=Dj$7e(B
e$B$F$$$^$9!#e(B

== e$B%W%j%3%s%Q%$%ke(B

— ruby_vm_compile_file(const char *filename)
— ruby_vm_compile_cstr(const char *src)
— ruby_vm_compile_string(VALUE srcstring)
e$B%9%/%j%W%H$r%3%s%Q%$%k:Q$_%G!<%?$KJQ49$9$k!#e(B

— ruby_vm_run_file(rb_vm_t *vm, const char *filename)
— ruby_vm_run_cstr(rb_vm_t *vm, const char *src)
— ruby_vm_run_string(rb_vm_t *vm, VALUE srcstring)
e$B%9%/%j%W%H$re(Bvme$B>e$G<B9T$9$k!#e(B

— ruby_vm_run_compiled(rb_vm_t *vm, compiled…)
e$B%3%s%Q%$%k:Q$_%G!<%?$re(Bvme$B>e$G<B9T$9$k!#e(B

— ruby_vm_run_cfun(rb_vm_t *vm, (func)(), void)
funce$B$re(Bvme$B>e$G<B9T$9$k!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:34239] MVM interface draft”
on Apr.03,2008 22:06:32, [email protected] wrote:

[email protected]!9=5$K$J$j$^$9$,!"[email protected]$5$s$H$$$m$$$mOC$79g$$$7$F$-$^$7$?!#$=e(B
e$B$N$&$A!"e(BMVMe$B$Ne(BCe$B%$%s%?!<%U%’!<%9$KIU$$$F$N7o$G$9!#e(B

e$B$^[email protected]$l$J$I$"$k$+$b$7$l$^$;$s$,!"$H$j$"$($:!#e(B

[email protected]$r$D$C$3$s$G$_$^$9!#e(B

  • e$BLa$jCM$N7?$,$J$$e(B

  • VALUE vme$B$He(Brb_vm_t *vme$B$,:.:_$7$F$$$ke(B

  • e$B8m;zC&;z$NN`e(B

— RUBY_INIT_STACK
e$B%a%$%s%M%$%G%#%V%9%l%C%I$N%9%?%C%/>pJs$rJ]B8$9$k!#e(B
e$B%M%$%F%#%Ve(B

— ruby_vm_parse_option(rb_vm_t *vm, int argc, const char *argv)
const char **argv

  • e$B$h$/$o$+$i$J$$e(B
rubye$B%9%l%C%I$H$7$F$NF0:n$r=*N;$9$k!#e(B

e$BL>A0$OL$Dj$G$9$,!“e(Bruby_vm_enter_thread()e$B$7$?>uBV$G%3!<%k%P%C%/$re(B
e$B8F$S=P$7$F!”=*N;8e$Ke(Bruby_vm_leave_thread()e$B$r<B9T$9$k$b$N$bM=Dj$7e(B
e$B$F$$$^$9!#e(B

e$B$3$l$i$O$I$&;H$o$l$k$s$G$7$g$&e(B?

e$B$=$l$G$O!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34239] MVM interface draft”
on Thu, 3 Apr 2008 22:06:32 +0900, Nobuyoshi N.
[email protected] writes:

|— RUBY_INIT_STACK
| e$B%a%$%s%M%$%G%#%V%9%l%C%I$N%9%?%C%/>pJs$rJ]B8$9$k!#e(B

e$B$3$l!"ITMW$K$7$?$$$b$N$G$9$M$(!#e(B

|— ruby_vm_init_env(VALUE vm, char **envp)
| vme$B$G;[email protected]_Dj$9$k!#e(B

ruby_vm_parse_option()e$B$Oe(Benvpe$B$r<u$1<h$i$J$$$N$O$=$l$G$$$$$s$Ge(B
e$B$9$+$M!#e(B

|— ruby_vm_register_thread(VALUE vm)
| e$B%M%$%F%#%V%9%l%C%I$KBP1~$9$ke(BThreade$B%$%s%9%?%s%9$r:[email protected]$7$F!"e(BVMe$B$KEPO?$9$k!#e(B
|
|— ruby_vm_release_thread(VALUE vm)
| Threade$B%$%s%9%?%s%9$+$i%M%$%F%#%V%9%l%C%I$r2rJ|$9$k!#e(B

registere$B$NH?BP$Oe(Bunregistere$B$G$7$g$&$+!#e(Breleasee$B$G$O$J$$$h$&$Ke(B
e$B46$8$^$9!#$^$?!"e(Bregistere$B$He(Bentere$B$O0UL#$,0c$&$s$G$7$g$&$+!#e(B

e$B$`$i$?$G$9!%e(B

2008/4/3 Nobuyoshi N. [email protected]:

[email protected]$G$9!#e(B

[email protected]!9=5$K$J$j$^$9$,!"[email protected]$5$s$H$$$m$$$mOC$79g$$$7$F$-$^$7$?!#$=e(B
e$B$N$&$A!"e(BMVMe$B$Ne(BCe$B%$%s%?!<%U%’!<%9$KIU$$$F$N7o$G$9!#e(B

e$B$^[email protected]$l$J$I$"$k$+$b$7$l$^$;$s$,!"$H$j$"$($:!#e(B

mod_ruby e$B$N$h$&$J%I%i%$%P$G$O!$8D!9$Ne(B VM e$BKh$KI8=`F~=PNO$Ne(B
IO e$B%*%V%8%’%/%[email protected][email protected]$H;W$$$^$9!%e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34244] Re: MVM interface draft”
on Fri, 4 Apr 2008 00:10:17 +0900, arton [email protected]
writes:

|> — ruby_vm_set_pwd(VALUE vm, const char *pwd)
|> vme$B$N%+%l%s%H%G%#%l%/%H%[email protected]_Dj$9$k!#e(B
|e$B$3$N$"$?$j$Ne(BAPIe$B$O!“3:Eve(BVMe$B$r<B9T$9$k%9%l%C%I!Je(Bruby_vm_rune$B$N8F$S=P$7A08e$He(B
|e$B$$$&$3$H$K$J$k$N$+$J!K$+$i$N8F$S=P$7G{$j$J$I$”$j$^$9$+!)e(B

e$B$H$$$&$+!"$=$b$=$b%+%l%s%H%G%#%l%/%H%j$O%W%m%;%9$4$H$N>pJs$Ge(B
e$B$9$Y$F$N%9%l%C%I$G6&M-$5$l$k$N$K;XDj$G$-$k0UL#$,$"$k$s$G$7$ge(B
e$B$&$+!#$=$l$H$bAjBP%Q%9$rH<$&$9$Y$F$NA`:n$K<j$rF~$l$F!"%9%l%Ce(B
e$B%I$4$H$K%+%l%s%H%G%#%l%/%H%j$r;}$F$k$h$&$K$9$k$N$+$J!#e(B

e$B$=$N>l9g$G$be(Bpwd(print working directory)e$B$h$j$Oe(Bcwd(current
working directory)e$B$NJ}$,NI$$$H;W$$$^$9!#e(B

In article [email protected],
Yukihiro M. [email protected] writes:

|— RUBY_INIT_STACK
| e$B%a%$%s%M%$%G%#%V%9%l%C%I$N%9%?%C%/>pJs$rJ]B8$9$k!#e(B

e$B$3$l!"ITMW$K$7$?$$$b$N$G$9$M$(!#e(B

e$B$&$^$$$d$j$+$?$,$"$l$P$$$$$s$G$9$,$M$’!#e(B

artone$B$G$9!#e(B

— ruby_vm_setenv(VALUE vm, const char *name, const char *value)
[email protected]_Dj$9$k!#e(B
— ruby_vm_set_pwd(VALUE vm, const char *pwd)
vme$B$N%+%l%s%H%G%#%l%/%H%[email protected]Dj$9$k!#e(B
e$B$3$N$"$?$j$Ne(BAPIe$B$O!“3:Eve(BVMe$B$r<B9T$9$k%9%l%C%I!Je(Bruby_vm_rune$B$N8F$S=P$7A08e$He(B
e$B$$$&$3$H$K$J$k$N$+$J!K$+$i$N8F$S=P$7G{$j$J$I$”$j$^$9$+!)e(B
e$B5$$K$J$C$?$N$O!"%(%s%8%s$N;EMM%P%0$J$I$G!"B>$N%9%l%C%I$G<B9TCf$Ne(BVMe$B$KBP$7e(B
e$B$F$3$l$i$N%a%=%C%I$r8F$S=P$7$F$7$^$&$3$H$G$9!#2>$K%/%j%F%#%+%k%;%/%7%g%se(B
[email protected]
$1$k$H$7$F$b!"<B9TCf$K%+%l%s%H%G%#%l%/%H%j$,JQ$o$k$H$$$&$N$O$^$:$=$&e(B
e$B$K;W$$$^$9!#e(B
e$B$?$H$($P!"e(B
[‘a’, ‘b’, ‘c’].each do |x|
File.open(x, ‘w’) do |f|
f.write foobar()
end
end
e$B$r<B9TCf$Ne(BVMe$B$KBP$7$F!“JL$N%9%l%C%I$+$ie(Bruby_vm_set_pwde$B$,8F$P$l$k$H!”%U%!e(B
e$B%$%ke(Ba,be$B$He(Bce$B$G0[$J$k%G%#%l%/%H%j$K:n$i$l$F$7$^$&$H$$$&$h$&$J%P%0$rA[Dj$7$Fe(B
e$B$$$^$9!#e(B

e$B3Fe(BVMe$B$,%M%$%F%#%V%9%l%C%I$GJB9TF0:n$G$-$k$h$&$K$9$k$?$a!"$=$l$>$le(B
e$BFHN)$7$?e(BObjectSpacee$B$r;}$A$^$9!#7k2L$H$7$F!"$"$ke(BVMe$B$G:n$i$l$?%*%Ve(B
e$B%8%’%/%H$rJL$Ne(BVMe$B$KEO$9$3$H$O$G$-$^$;$s!#e(B

Rubye$B$G<B9T$9$l$PNI$$$H$b;W$$$^$9$,!“e(BVMe$B$rJ,3d$9$k$3$H$G<B9T%3%s%F%-%9%H$re(B
e$BJ,$1$?e(BWebe$B%”%W%j%1!<%7%g%s$G!"%a%b%j!<>e$KJ];}$9$k%;%C%7%g%s>pJs$r8r49$9e(B
e$B$k!"$"$k$$$Oe(Bvme$B$rESCf$+$iDI2C$9$k$H$$$&%7%J%j%$r9M$($k$H!"%%V%8%’%/%H$Ne(B
VMe$B4V$N%3%T!<$^$?$O0\F0$r9T$&e(BCe$B$Ne(BAPIe$B$,MQ0U$5$l$F$$$k$[$&$,K>$^$7$/;W$$$^$9!#e(B
ruby_object_copy(VALUE vm_from, VALUE vm_to, VALUE target_obj);
e$B!JFbIt$G%^!<%7%c%k!?%"%s%^!<%7%c%k$,9T$o$l$k!Ke(B
ruby_import_objectsapce(VALUE vm_from, VALUE vm_to, VALUE objectspace);
e$B!J=q$$$F$+$i5$$E$-$^$7$?$,!“e(Bruby_vm_clone(VALUE
vm_from)e$B$,$”$l$PNI$$$N$+e(B
e$B$b!Ke(B

e$B4m81$J%*%Z%l!<%7%g%[email protected]$O>5CN$7$F$$$^$9$,!"%(%s%8%sB&$GMQ0U$7$?e(B
e$B4F;k%9%l%C%I!Je(Bruby_vm_enter_threade$B$7$?%9%l%C%I$H$O0[$J$k%9%l%C%I!K$+$i!“e(B
e$B<B9TCf$Ne(Bvme$B!J%9%l%C%[email protected]$10BA4$K;&$9$?$a$Ne(B
ruby_vm_shutdown(VALUE vm);
e$B$”$k$$$Oe(B
ruby_vm_kill(VALUE vm);
e$B$;$a$Fe(B
ruby_vm_raise_exception(VALUE vm, VALUE exception);
e$B$rMQ0U$7$FM_$7$$$G$9!J$7$+$b!"e(BWin32e$B$G<B9T2DG=$J$h$&$K%7%0%J%k$KMj$i$:$K!K!#e(B

[email protected]$G$9!#e(B

At Thu, 3 Apr 2008 22:26:40 +0900,
U.Nakamura wrote in [ruby-dev:34241]:

rubye$B%9%l%C%I$H$7$F$NF0:n$r=*N;$9$k!#e(B

e$BL>A0$OL$Dj$G$9$,!“e(Bruby_vm_enter_thread()e$B$7$?>uBV$G%3!<%k%P%C%/$re(B
e$B8F$S=P$7$F!”=*N;8e$Ke(Bruby_vm_leave_thread()e$B$r<B9T$9$k$b$N$bM=Dj$7e(B
e$B$F$$$^$9!#e(B

e$B$3$l$i$O$I$&;H$o$l$k$s$G$7$g$&e(B?

rubye$B%(%s%8%s$NCN$i$J$$$H$3$m$G:n$i$l$?%M%$%F%#%V%9%l%C%I$+$i!"e(B
rubye$B%(%s%8%s$r8F$S=P$7$?$$$H$-$G$9!#e(B

[email protected]$G$9!#e(B

At Thu, 3 Apr 2008 23:14:12 +0900,
Yukihiro M. wrote in [ruby-dev:34243]:

|— RUBY_INIT_STACK
| e$B%a%$%s%M%$%G%#%V%9%l%C%I$N%9%?%C%/>pJs$rJ]B8$9$k!#e(B

e$B$3$l!"ITMW$K$7$?$$$b$N$G$9$M$(!#e(B

e$B7c$7$/%W%i%C%H%U%)!<%`$K0MB8$9$k$s$G$9$h$M!#e(BWin32e$B$H$+e(Bproc
fse$B$N$"e(B
e$B$k4D6-$J$i$G$-$k$s$G$9$,!#e(B

|— ruby_vm_init_env(VALUE vm, char **envp)
| vme$B$G;[email protected]_Dj$9$k!#e(B

ruby_vm_parse_option()e$B$Oe(Benvpe$B$r<u$1<h$i$J$$$N$O$=$l$G$$$$$s$Ge(B
e$B$9$+$M!#e(B

e$BFH<+$Ne(Benvpe$B$r;H$$$?$$$3$H$,$I$NDxEY$"$k$+$G$9$,!"$"$C$?$[$&$,$$$$e(B
e$B$G$7$g$&$+!#e(B

|— ruby_vm_register_thread(VALUE vm)
| e$B%M%$%F%#%V%9%l%C%I$KBP1~$9$ke(BThreade$B%$%s%9%?%s%9$r:[email protected]$7$F!"e(BVMe$B$KEPO?$9$k!#e(B
|
|— ruby_vm_release_thread(VALUE vm)
| Threade$B%$%s%9%?%s%9$+$i%M%$%F%#%V%9%l%C%I$r2rJ|$9$k!#e(B

registere$B$NH?BP$Oe(Bunregistere$B$G$7$g$&$+!#e(Breleasee$B$G$O$J$$$h$&$Ke(B
e$B46$8$^$9!#$^$?!"e(Bregistere$B$He(Bentere$B$O0UL#$,0c$&$s$G$7$g$&$+!#e(B

Threade$B%$%s%9%?%s%9$N:[email protected]$O=E$$$N$GFHN)$5$;$?$$$H$$$&[email protected]$C$?$He(B
e$B;W$$$^$9!#e([email protected]$jBX$([email protected]$1$J$N$G7Z$/$J$k$H$$$&$3$He(B
e$B$G!#e(B

[email protected]$G$9!#e(B

At Fri, 4 Apr 2008 05:41:44 +0900,
Yukihiro M. wrote in [ruby-dev:34247]:

|> — ruby_vm_set_pwd(VALUE vm, const char *pwd)

|> vme$B$N%+%l%s%H%G%#%l%/%H%[email protected]_Dj$9$k!#e(B
|e$B$3$N$"$?$j$Ne(BAPIe$B$O!“3:Eve(BVMe$B$r<B9T$9$k%9%l%C%I!Je(Bruby_vm_rune$B$N8F$S=P$7A08e$He(B
|e$B$$$&$3$H$K$J$k$N$+$J!K$+$i$N8F$S=P$7G{$j$J$I$”$j$^$9$+!)e(B

e$B$3$NJU$Oe(Bvm_rune$B0J9_$OIT2D$H9M$($F$$$^$9!#$"$/$^$G=i4|>[email protected][email protected](B
e$B$1$J$N$G!#e(B

e$B$H$$$&$+!"$=$b$=$b%+%l%s%H%G%#%l%/%H%j$O%W%m%;%9$4$H$N>pJs$Ge(B
e$B$9$Y$F$N%9%l%C%I$G6&M-$5$l$k$N$K;XDj$G$-$k0UL#$,$"$k$s$G$7$ge(B
e$B$&$+!#$=$l$H$bAjBP%Q%9$rH<$&$9$Y$F$NA`:n$K<j$rF~$l$F!"%9%l%Ce(B
e$B%I$4$H$K%+%l%s%H%G%#%l%/%H%j$r;}$F$k$h$&$K$9$k$N$+$J!#e(B

openate$B7O$N$"$k4D6-$G$O$=$l!"$J$1$l$P%+%l%s%H%G%#%l%/%H%j$re(BVMe$B$+%9e(B
e$B%l%C%I$4$H$K;}$?$;$h$&$+$H;W$C$F$^$9!#e(B

e$B$=$N>l9g$G$be(Bpwd(print working directory)e$B$h$j$Oe(Bcwd(current
working directory)e$B$NJ}$,NI$$$H;W$$$^$9!#e(B

getpwde$B$Ne(Bpe$B$Oe(Bpresente$B$8$c$"$j$^$;$s$G$7$?$C$1!#e(B

#e$B$D$$$G$K0l=o$Ke(B

At Fri, 4 Apr 2008 00:10:17 +0900,
arton wrote in [ruby-dev:34244]:

Rubye$B$G<B9T$9$l$PNI$$$H$b;W$$$^$9$,!“e(BVMe$B$rJ,3d$9$k$3$H$G<B9T%3%s%F%-%9%H$re(B
e$BJ,$1$?e(BWebe$B%”%W%j%1!<%7%g%s$G!"%a%b%j!<>e$KJ];}$9$k%;%C%7%g%s>pJs$r8r49$9e(B
e$B$k!"$"$k$$$Oe(Bvme$B$rESCf$+$iDI2C$9$k$H$$$&%7%J%j%$r9M$($k$H!"%%V%8%’%/%H$Ne(B
VMe$B4V$N%3%T!<$^$?$O0\F0$r9T$&e(BCe$B$Ne(BAPIe$B$,MQ0U$5$l$F$$$k$[$&$,K>$^$7$/;W$$$^$9!#e(B

e$B$=$l$OK:$l$F$^$7$?$,!":#$N$H$3$m8!F$2]Bj$G$9!#e(B

e$B4m81$J%*%Z%l!<%7%g%[email protected]$O>5CN$7$F$$$^$9$,!"%(%s%8%sB&$GMQ0U$7$?e(B
e$B4F;k%9%l%C%I!Je(Bruby_vm_enter_threade$B$7$?%9%l%C%I$H$O0[$J$k%9%l%C%I!K$+$i!“e(B
e$B<B9TCf$Ne(Bvme$B!J%9%l%C%[email protected]$10BA4$K;&$9$?$a$Ne(B
ruby_vm_shutdown(VALUE vm);
e$B$”$k$$$Oe(B
ruby_vm_kill(VALUE vm);
e$B$;$a$Fe(B
ruby_vm_raise_exception(VALUE vm, VALUE exception);
e$B$rMQ0U$7$FM_$7$$$G$9!J$7$+$b!"e(BWin32e$B$G<B9T2DG=$J$h$&$K%7%0%J%k$KMj$i$:$K!K!#e(B

e$B%7%0%J%k$bCj>]2=$7$FE}9g$G$-$k$h$&$J!"%$%Y%s%H%O%s%I%j%s%0$N5!9=e(B
e$B$rMQ0U$7$h$&$H$$$&9M$($O$"$j$^$9!#e(BVMe$B4VDL?.$K$D$$$F$O$^[email protected]*$Ke(B
e$B7h$^$C$F$$$k$o$1$G$O$J$/$F!"[email protected]$5$s$H$O!V$H$j$"$($:$Oe(Bdrubye$B%be(B
e$B%G%k$G$b$$$$$s$8$c$J$+$m$&$+!W$H$$$&OC$r$7$F$$$^$9!#e(B

[email protected]$G$9!#e(B

At Fri, 4 Apr 2008 00:57:43 +0900,
Kenta M. wrote in [ruby-dev:34245]:

mod_ruby e$B$N$h$&$J%I%i%$%P$G$O!$8D!9$Ne(B VM e$BKh$KI8=`F~=PNO$Ne(B
IO e$B%*%V%8%’%/%[email protected][email protected]$H;W$$$^$9!%e(B

e$B3N$+$K!#$"$j$,$H$&$4$6$$$^$9!"$3$l$bK:$l$F$^$7$?!#e(B

e$BB>$KK:$l$F$k$b$N$O!D!#e(B

umaske$B$O2DG=$+$b$7$l$J$$$1$l$I!"<j4V$H;HMQIQEY$+$iM%@hEY$ODc$a$+e(B
e$B$J$!!#e(Buid,gide$B$O$5$9$,$KL5M}[email protected]$m$&$7!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:34256] Re: MVM interface draft”
on Sat, 5 Apr 2008 10:36:53 +0900, Nobuyoshi N.
[email protected] writes:

|> > e$B$H$$$&$+!"$=$b$=$b%+%l%s%H%G%#%l%/%H%j$O%W%m%;%9$4$H$N>pJs$Ge(B
|> > e$B$9$Y$F$N%9%l%C%I$G6&M-$5$l$k$N$K;XDj$G$-$k0UL#$,$"$k$s$G$7$ge(B
|> > e$B$&$+!#$=$l$H$bAjBP%Q%9$rH<$&$9$Y$F$NA`:n$K<j$rF~$l$F!"%9%l%Ce(B
|> > e$B%I$4$H$K%+%l%s%H%G%#%l%/%H%j$r;}$F$k$h$&$K$9$k$N$+$J!#e(B
|
|openate$B7O$N$"$k4D6-$G$O$=$l!"$J$1$l$P%+%l%s%H%G%#%l%/%H%j$re(BVMe$B$+%9e(B
|e$B%l%C%I$4$H$K;}$?$;$h$&$+$H;W$C$F$^$9!#e(B

e$B$=$3$^$G$9$k0UL#$,$"$k$s$G$9$+$M$(!#e(B

|> > e$B$=$N>l9g$G$be(Bpwd(print working directory)e$B$h$j$Oe(Bcwd(current
|> > working directory)e$B$NJ}$,NI$$$H;W$$$^$9!#e(B
|
|getpwde$B$Ne(Bpe$B$Oe(Bpresente$B$8$c$"$j$^$;$s$G$7$?$C$1!#e(B

getpwde$B$C$F%i%$%V%i%j%3!<%k$O$"$j$^$;$s$h$M!#$"$k$N$Oe(Bgetcwde$B$G!#e(B

[email protected]$G$9!%e(B

Nobuyoshi N. wrote:

registere$B$NH?BP$Oe(Bunregistere$B$G$7$g$&$+!#e(Breleasee$B$G$O$J$$$h$&$Ke(B
e$B46$8$^$9!#$^$?!"e(Bregistere$B$He(Bentere$B$O0UL#$,0c$&$s$G$7$g$&$+!#e(B

Threade$B%$%s%9%?%s%9$N:[email protected]$O=E$$$N$GFHN)$5$;$?$$$H$$$&[email protected]$C$?$He(B
e$B;W$$$^$9!#e([email protected]$jBX$([email protected]$1$J$N$G7Z$/$J$k$H$$$&$3$He(B
e$B$G!#e(B

e$B!!e(Bregister e$B$8$c$J$/$Fe(B enter e$B$G$9$M!%e(B

e$B$=$&$$$($P!$0z?t$Oe(B VALUE vm e$B$8$c$J$/$Fe(B rb_vm_t *vm

e$B$G$9$M!%e(B

e$B!!e(BRuby e$B$HA4$/4X78$J$$e(B Native Thread e$B$K$F!$e(B

ruby_vm_register_thread(vm);
ruby_vm_enter_thread(vm, ptr); // ptr: GC top e$B$N$?$a$N%]%$%s%?e(B
… // Ruby e$B$Ne(B VALUE e$B$K?($k2?$+$r$9$k!%e(B
ruby_vm_leave_thread(vm);

… // e$B$3$3$G$Oe(B Ruby e$B$Ne(B VALUE e$B$K?($l$J$$e(B

ruby_vm_enter_thread(vm, ptr); // ptr: GC top e$B$N$?$a$N%]%$%s%?e(B
… // Ruby e$B$Ne(B VALUE e$B$K?($k2?$+$r$9$k!%e(B
ruby_vm_leave_thread(vm);

ruby_vm_release_thread(vm);
// e$B40A4$Ke(B vm e$B$He(B native thread [email protected]$jN%$9e(B

enter/leave e$B$Oe(B callback e$B$G;H$&$h$&$JMQES$rA[Dj$7$F$$$^$9!%e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs