> I am creating a Unix based application which consist of a TCP Server
> part. In most of the examples I looked at contains the usage of
> "fork()" when a new client request received at the server side. May I
> can use thread instaed of this fork. If possible which one is more
> better and why?.
> 
Yes, you could use either. You can find examples of thread based server in the 
Sun's Java tutorial (I think, else just google for it)

With fork, each client would be service by a separate process (a new PID). With 
threads, its all within the same process. 

For certain applications, the number of clients can be too high (e.g. 
websites). 

In those cases, fork can become unsuitable, as you may start hitting the limits 
for the Maximum number of processes allowed.. (and need to tweak the box etc). 

Cheers, 
Vivek


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
linux-india-help mailing list
linux-india-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to