From: Eric Wong Date: 2011-04-13T07:37:06+09:00 Subject: [ruby-core:35730] Re: mvm branch status? Charles Oliver Nutter wrote: > On Sun, Apr 10, 2011 at 11:28 PM, Urabe Shyouhei wrote: > > What C APIs are safe to use with MVM is not fully certain yet. ��For instance > > there are process-global states other than C global variables like current > > 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. > > I'm not sure how MRI would do the same, since it is much more > dependent on low-level C APIs and their expectation of per-process > cwd. POSIX.1-2008 has openat(), renameat(), chownat(), etc.., which can be used for implementing per-thread/VM working directories. It might take a while for more platforms to support them, but Linux has had them for a few years. -- Eric Wong