At 10:19 +0900 1/23/03, Tom Sawyer wrote:
>i'm tired of being confused about this and i'm hoping someone can clear this
>up for me.
>
>when i make a request to apache on a mod_ruby script, i know that the ruby
>interpreter is embedded into apache so that a new instace of ruby does not
>have to be started every time. so then global variables and class definitions
>including class variables persist between connections. right? so if i'm USER1
>and i request a ruby app that creates a global variable or an object instance
>with a defined class variable, then when USER2 requests the same app, will
>the gloabal variable or class variable be set as it was for USER1?

It depends?

The Apache parent process may spawn a number of children.  Suppose the
request from USER1 is serviced by child A.  If the request from USER2
is also serviced by child A, then it'll be getting the same mod_ruby.
If it's serviced by a different child, all bets are off.

Moral: You can't rely on the behavior that you appear to want to rely on.

>
>thanks,
>--
>tom sawyer, aka transami
>transami / transami.net