iCode
iCode

Reputation: 4338

ASP.NET MVC 3 Controller Concurrency Model

What is the concurrency model behind ASP.NET MVC 3? I mean, when many users are accessing a ASP.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?

Upvotes: 3

Views: 801

Answers (2)

Craig Stuntz
Craig Stuntz

Reputation: 126547

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.

Upvotes: 2

Steve Morgan
Steve Morgan

Reputation: 13091

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

There's interesting reading here.

Upvotes: 4

Related Questions