Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a third party dll that called from some of my WCF services, sitting on iis 10.
This dll used a static variables. So in working MultiThreaded the memory is crushed.
(one thread override the other thread memory).
I dont want to use lock in my code because of performance.
I want to configure the IIS so that each application pool execute multi worker processes
and each process will execute only one thred.
Wich will avoid memory overriding, because every process has is own memory.

What I have tried:

I tried to change the parameter "Thread Per Processor Limit" in
IIS => ASP => Limited Properties , from 25 to 1.
I also increase the parameter "Maximum Worker Processes" in
IIS => Application Pool => My app => Process Model, from 1 to 25.

But actually,
In task manager there is 25 w3wp.exe process but in the "thred" column, I see
about 40 thread to each process.

If someone has explanation for me, I'll be Grateful.

Thanks.
Posted
Comments
F-ES Sitecore 21-Jan-19 5:06am    
Static variables are shared among the application domain, not the thread. Assuming the object does everything in a single operation and you don't need it to maintain state over a period of time, then using a lock to ensure only one thread at a time calls the code is probably the only solution. It is bad for performance, but you're using a dll that clearly wasn't intended to be used in a multi-threaded environment.
Member 13587927 21-Jan-19 5:55am    
Hi,
So what is the meaning of the parameter "Thread Per Processor Limit"?

thank's a lot.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900