# Rails assumption about getting new thread on each request

**URL:** <https://www.ruby-forum.com/t/rails-assumption-about-getting-new-thread-on-each-request/164973>\
**Category:** Rails\
**Created:** [April 7, 2009, 10:24pm UTC](https://www.ruby-forum.com/t/rails-assumption-about-getting-new-thread-on-each-request/164973 "2009-04-07T22:24:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![buddycat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ab097/32.png) [@buddycat](https://www.ruby-forum.com/u/buddycat)\
**Post date:** [April 7, 2009, 10:24pm UTC](https://www.ruby-forum.com/t/rails-assumption-about-getting-new-thread-on-each-request/164973/1 "2009-04-07T22:24:13Z")

</div>

hi all,

i am wondering if there is consensus around whether it is an  
assumption of the rails core that each request will be served by a  
new, clean thread? i ask because i am using Thread.current hash and  
while mongrel seems to handle each request with a new thread and so  
Thread.current is clean, passenger serves the same thread each time.

besides my own selfish uses, this seems to be pertinent to several  
places in rails core where Thread.current is set with ||=

ror/vendor/rails/activesupport/lib/active\_support/vendor/i18n-0.1.3/  
lib/i18n.rb:40: Thread.current[:locale] ||= default\_locale  
ror/vendor/rails/activesupport/lib/active\_support/core\_ext/time/  
zones.rb:15: Thread.current[:time\_zone] || zone\_default  
ror/vendor/rails/activerecord/lib/active\_record/base.rb:2189:  
Thread.current[:"#{self}\_scoped\_methods"] ||= self.default\_scoping.dup

so, what is the expected behavior for a webserver?
