Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Sep : Multi-threaded Winsock or IOCP?

www.cryer.info
Managed Newsgroup Archive

Multi-threaded Winsock or IOCP?

Subject:Multi-threaded Winsock or IOCP?
Posted by:"kei" (nospam@nospam.org)
Date:20 Sep 2006 02:10:17

Hello,

I have designed a model for basic server-client communication using multiple threads. On the server side, there is a "listening thread" which will loop and accept() until user-break, and whenever a new client connects, a new "session thread" (along with a new session-socket) is spawned. Then all requests will be entertained by this session thread..

But when I read some articles today, I realized that maximum of 2 threads for winsock, is recommended.. moreover, an application cannot create more than 2000 threads. the article suggested to use "I/O Completion Ports" which I have no idea about..

My questions are...

1. I still want to have multiple clients talking to a server simutaneously, and have their requests fulfilled simutaneously
2. That means I will need multiple threads, right? Are there any alternatives?
3. What are the fundemental concept behind IOCP? Isn't it just another multi-thread solution?
4. What is a thread-pool? What is the difference between this, and IOCP?

Thanks!!

Kei

Replies:

www.cryer.info
Managed Newsgroup Archive