Hi, On Wed, Apr 13, 2011 at 06:56, Charles Oliver Nutter <headius / headius.com> wrote: > On Sun, Apr 10, 2011 at 11:28 PM, Urabe Shyouhei <shyouhei / ruby-lang.org>= wrote: >> What C APIs are safe to use with MVM is not fully certain yet. =A0For in= stance >> there are process-global states other than C global variables like curre= nt >> directory, signal masks, ... We are still exploring. > > For current directory, JRuby maintains that separately and any calls > that are sensitive to cwd are modified to use this per-runtime value. > Because we share the JVM, we can't safely chdir the entire process, so > this was really the only way. Shyouhei's branch works as the same. % ./ruby-mvm -e 'p Dir.pwd; 2.times { RubyVM.new("ruby", "-e", "Dir.chdir %q(.ext); p Dir.pwd").start }; sleep 1' "/home/nahi/git/shyouhei-ruby/build" "/home/nahi/git/shyouhei-ruby/build/.ext" "/home/nahi/git/shyouhei-ruby/build/.ext" https://github.com/shyouhei/ruby/tree/shyouhei%2Fmvm-topicalization Shyouhei's branch introduced per VM initialization (InitVM_*) and some ext/* extensions changed to use it. The remaining issue is that there should be more exts which depends on C's static thing. libssl has global error stack so ext/openssl must handle this... Is it worth trying? Regards, // NaHi