   Multithreading or not in small win32 chat?
  Hi! I'm trying to optimise my small win32 client server application. I will only use one client and therefore only one socket.. Should I let the socket connection be part of my windows message loop? Or should I use multithreading?Should I use multithreading only when I want to connect with multiple clients?Thank you [edited by - franky on February 16, 2004 4:31:33 PM]
  You don''t neecssarily have to use multi-threading at all. Writing a single-threaded server that uses asynchronous sockets is usually a more scalable way to go. Once you need real CPU power, using one thread for networking and one for processing might help, but one thread per client is likely to melt down your server way earlier than single-threaded asynchronous would. ;  ok??You wouldn’t happen to know where I can find a small tutorial about asynchronous handling of multiple clients.. It would be an interesting study : )Thank you for your reply!;quote:Original post by franky  ok??You wouldn’t happen to know where I can find a small tutorial about asynchronous handling of multiple clients.. It would be an interesting study : )Thank you for your reply! Great article by Gaiiden.;  Thank you Is it common to use one socket for listening for client,and one for recieving data? ;  you send/receive off the same socket. 