Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
For a task based application (handles n number of clients) that assigns all the tasks in main (application) thread, I plan to assign each customer a thread and assign task to each thread. How will be the performance? Any suggestion would be great..thanks in advance.
Posted

1 solution

Threads are resource expensive so assigning one to each customer is not scalable but having a pool of threads (usually much lower than the number of customers) and assigning work to those threads is per request is.

Tasks are lighter weight processing units which work on threads in the background and scale much better.

The general answer to your question of performance is : it depends on the nature of your processing, so you must test it.
 
Share this answer
 
Comments
vbn.saravanakumar 31-Jul-14 12:48pm    
Thank you Mehdi Gholam. I understood..

Current situation is, we are having a server with 4 core and 32 GB RAM..But still our app (with System.Threading.Tasks) but is using only one core. Sometime the server hangs up though the other cores are still free.
We are trying to optimize and use all the cores..

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