I am doing some research on developing thread safe applications. I know users can use multiple threads on the same application (if the CPU works with more than one thread) but I am not sure what happens, and how IIS handles users when you have 5 users using the same application for example.
What does IIS do, are all the users working on the same thread? or are they given a thread each for example?
I am a newbie when it comes to IIS, so please bear with me. My question will help me understand whether I need to lock public static methods in my code (where thread safety is important).
IIS is a multi-threaded web server, because multi-threading is really the only way to achieve high-concurrency high-performance server applications on Windows (processes aren't as cheap as they are on Nix).
IIS (and thus IISExpress, which is IIS packaged in an "application" format) is multi-threaded.
The “hard” limit on the max number of threads in the IIS thread pool. This limit can be set to a value between 64 and 256, so you cannot have more than 256 IIS threads in the pool regardless of settings.
To see how many threads are possible in an IIS server for specific hardware, Click on the server. Then on the right side pane, double click on ASP like this. The ASP Threads Per Processor Limit property specifies the maximum number of worker threads per processor that IIS creates.
Here is a good read to start with - ASP.NET Thread Usage on IIS 7.5, IIS 7.0, and IIS 6.0. The important thing you should remember - IIS will not create threads for users, it will create threads for concurrent calls. And of course you should create thread safe static methods, if they are not the pure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With