Hi guys,
I startin the project of a (web) server in c++ and i want to able to manage about 1000-2000 clients.
I have been reading alot about Single-thread VS Multi-thread server and i wanna know what u guys think about it.
I do not plan on using one-thread-per-client because i have heard that its too slow for 1000+ clients.
On the begin , i was 100% about using about 5 threads , by service:
1 for the Window Console (so the user can see its information without freezy the window)
1 for sending data
1 for receving data
1 for Accepting new clients
1 for computing the ugly processes (AI)
But then I heard about ppl sayin that have done webservers with only 1 thread (3 in my case, cause 1 for the window, 1 for acceptin new clients and 1 AI, Receving, Sending data), and i came up with the thought that if i do only use 1 thread for Receive,Sending and AI I wouldnt need to Lock/Unlock so much data (in those 3 processes). This could save alot of the processor's time, i guess.
What i wanna know is that, would u guys try to put the Receive,Sending and AI in just 1 process?
and
(Even though i believe dont, i need to make sure:) Would the access to the database (mysql in my case) LOCK my thread for a couple ms? or its just like another function call?
Thanks alot for the help =)
Marcosedu