Threads

G

Guest

Im starting now to write a big chat server that is built to hold a max of
1000 users.
Im having a trouble to find the best way to hold this users...
i have 2 ideas, one is to create a thread for each user
and each user thread socket will read/write in a blocking mode.
or to create 25 threads which is the max of the thread pool
and each thread will handle up to 40 socket asynchronously..
this way thread pool will work efficiently..

what to do ?? :)
 
M

Miha Markic [MVP C#]

Hi Shimi,

ShimiIL said:
Im starting now to write a big chat server that is built to hold a max of
1000 users.
Im having a trouble to find the best way to hold this users...
i have 2 ideas, one is to create a thread for each user
and each user thread socket will read/write in a blocking mode.
or to create 25 threads which is the max of the thread pool
and each thread will handle up to 40 socket asynchronously..
this way thread pool will work efficiently..

what to do ?? :)

You should reads MSDN Magazine ;-)
http://msdn.microsoft.com/msdnmag/issues/05/08/HighPerformanceSockets/default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top