On Tue, 24 Jul 2001 18:44:25 +0900, Michael Neumann <uu9r / rz.uni-karlsruhe.de> wrote in comp.lang.ruby: >> > You can't share variables because Apache creates multiple >> > processes. >> > So it is not a good idea to use global variables on mod_ruby. > >Thanks for the clarification. I heard it once before anywhere but >wasn't really sure about it. > >Is this fact only true for mod_ruby or behaves mod_perl etc.. >in the same way? All of this may be a moot point very soon. Although Apache 1.X uses fork() to create child processes, Apache 2.X will create multiple threads to handle requests. This means that variables created during the initialization phase will be shared with the children. If you use PerlRequire or RubyRequire in your httpd.conf to bring external modules into your Apache process then you will need to make your code thread-safe by declaring variables as volatile and using a mutex.