UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C
  • » Question about server threads implementation

#1 2011-06-05 06:59 PM

rcbanditg
Guest

Question about server threads implementation

Hi,
   I have a question about network programming. I need to implement network server which must handle network clients. How to implement it:

1. Using threaded pool - when the server daemon is started for example 60 threads are created and each new client is handled by one thread. When the client processing is finished the thread is freed and ready for use again. I heard that in the threaded pool solution the server vulnerable to DDOS attack.

2. Using new thread for each new client - when the server must process client request he creates new thread and the thread handles the client. When the processing is finished the thread is destroyed.

So which one of them can you recommend me to use?
Is there another solution?

Regards
Peter

#2 2011-06-06 08:39 AM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: Question about server threads implementation

Offline

#3 2011-06-06 12:15 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: Question about server threads implementation

Offline

#4 2011-08-19 05:30 PM

developwyo
Member
Registered: 2011-08-16
Posts: 6

Re: Question about server threads implementation

Last edited by developwyo (2011-09-22 05:48 PM)

Offline

  • Index
  • » C
  • » Question about server threads implementation

Board footer

Powered by FluxBB