Open MatheswaranSagadevan opened 2 years ago
Hi,
I assume that your application works like a service. Hence, always running and serve requests.
I think you should instatiate the smart thread pool only once in a singleton with min and max threads. Later on create work item groups with the concurrency you need and queue work items into them. Since your application work like a service (as I assumed) you don't need to call to shutdown or dispose at all. When you stop the service you can use WaitForIdle() to wait for incompleted work items to finish.
Regards, Ami
Great, you are right it is a service. and I'm fine to use WaitForIdle instead of shutdown.
and how about Memory management.? any best practices and troubleshooting tips? because we often face outofmemory exception.
The outofmemory exception is out of my scope. I assume you get the exception becuase you get too many requests than you can handle so the backlog explodes. Try to limit the backlog to avoid requests overflow.
Hi, We recently explored STP, and started using it in one of our asp.net core application. and our implementation is like, during particular object's constructor we configure/instantiate the smart thread pool with work item groups and min, max threads etc.
There are two questions:
Thanks, Matheswaran S