2008-10-29から1日間の記事一覧

Rails 2.2の threadsafe と ConnectionPool を読んでみる#3

次は ConnectionPool について.ひとまず関連部分を出すために % rak 'ConnectionPool' --ruby で activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb 19| # connection back in. ConnectionPool is completely thread-safe, …

Rails 2.2の threadsafe と ConnectionPool を読んでみる#4

と言うことは,threadsafe! によっては ActionController 側では同期しなくなっただけ. ActiveRecord 側では,ConnectionPool によって接続を使いまわすようになっただけ. かな?次は IRC で上がってた http://m.onkey.org/2008/10/23/thread-safety-for-y…

Rails 2.2の threadsafe と ConnectionPool を読んでみる#2

続き.actionpack/lib/action_controller/dispatcher.rb を見ると 5 | @@guard = Mutex.new 104 | def dispatch_unlocked 105 | begin 106 | run_callbacks :before_dispatch 107 | handle_request 108 | rescue Exception => exception 109 | failsafe_resc…

Rails 2.2の threadsafe と ConnectionPool を読んでみる#1

まず thread safe にする設定は config/environments/production.rb にある # Enable threaded mode # config.threadsafe! からなので,これを調べると railties/lib/initializer.rb の