ActionController::Base.allow_concurrencyの話

mongrelActionController::Base.allow_concurrencyをtrueにすると、スレッドの処理を排他的にしないという話があって、ふーんと思ってソース見てみたら、mongrelの1.0.1では絶対に同期を取るようになってた。

@guard.lock unless ActionController::Base.allow_concurrency

Dispatcher.dispatch(cgi, ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, response.body)
@guard.synchronize {
  @active_request_path = request.params["PATH_INFO"] 
  Dispatcher.dispatch(cgi, ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, response.body)
  @active_request_path = nil
}

あと、Railsではそこんとこどうなっているんだろうと思って、action_controllerとrailsのソースを見てみたけど、処理が排他的になるのはロックかかるのはセッションのメモリストア/ファイルストアのとこと、Webrickまわりだけだった。

排他制御mongrelFastCGIにお任せってことかしらん?