2

This is a question about MT safe on jruby on rails.

I just want to confirm that there is no MT safe issue to use controller instance variable.

In fact, the same question is that for each http request, rails will spawn a controller instance to process it or rails will reuse the same controller instance with different threads(just like servlet instance)?

I.E.,If one controller instance for one http request, then controller instance variable has NO MT safe issue,

If more than one thread share one controller instance, then controller instance variable has MT safe issue

Another similar questions is Thread-safe Rails controller actions - setting instance variables?

4
  • 1
    What further information would you like besides the answer in the other question? Commented Aug 22, 2012 at 3:32
  • In fact, I don't think we get the confirmed answer from the other question. Commented Aug 22, 2012 at 8:07
  • It wouldn't be any more 'confirmed' if I copied my answer from that question to this one. Commented Aug 22, 2012 at 8:37
  • Sorry, seems I missed Frederick Cheung's reply on the similar question(I focus on Jruby, instead of MRI). Your answer is what I want. Thanks. Commented Aug 22, 2012 at 11:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.