3

What is the concurrency model behind aps.net MVC 3? I mean, when many users are accessing a aps.net MVC 3 website, do we have a new instance of controller for each request or the one controller is shared for one user session or all users?

Could you point to some proper documentation on this?

iCode
  • 4,308
  • 10
  • 44
  • 77

2 Answers2

4

Yes, if you use the default controller factory, each request instantiates a new controller instance.

There's interesting reading here.

Steve Morgan
  • 12,978
  • 2
  • 40
  • 49
2

Yes, you get a single instance for each request which is disposed at the end of the request. The best documentation I know of for such details is the source code.

I described the flow which calls Controller.Dispose in this older question.

Community
  • 1
  • 1
Craig Stuntz
  • 125,891
  • 12
  • 252
  • 273