Assignment 6
Assignment 6
There are many issues faced when multiple clients are handled, like efficient utilization of
memory, avoiding monopolization of a single client e.t.c. Here we will discuss two of many
strategies to implement on server to handle this:
Multi-Process Programming
Multi-Threaded Programming
Multi-Process Programming for Server Implementation:
In multiprocessing each process has its own address space,whereas in multi-threading
all the threads of the process share its own address space. Using fork() command which is
main command for multiprocessing, we can create an exact copy of the program right under
the program counter of fork() call. The main disadvantage of this forking is lack of shared
memory, as big programs will be copied in child.
Multi-Threaded Programming for Server Implementation:
Threads are light weight processes that shares the main memory of the process and
because of this the context-time(time taken to shift from execution of one thread to another)
is less but error in one thread can bring down the whole server.
References:
The Definitive Guide to Linux Network Programmingby Keir Devis, John Turner
Youtube video Difference b/w Multi-threading and Multiprocessing by Neeraj sir
Youtube Video Linux fork() Introduction by DrBFraser