0% found this document useful (0 votes)
35 views1 page

Assignment 6

Multi-Process and Multi-Thread Programming discusses strategies for implementing servers to efficiently handle multiple clients. It describes multi-process programming, where each process has its own address space, and multi-threaded programming, where threads within a process share the same address space. The document notes that multi-processing uses fork() to create copies of a program, but this lacks shared memory, while multi-threading has lower context switching time but errors can bring down the whole server.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

Assignment 6

Multi-Process and Multi-Thread Programming discusses strategies for implementing servers to efficiently handle multiple clients. It describes multi-process programming, where each process has its own address space, and multi-threaded programming, where threads within a process share the same address space. The document notes that multi-processing uses fork() to create copies of a program, but this lacks shared memory, while multi-threading has lower context switching time but errors can bring down the whole server.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

IIST, D EPARTMENT OF AVIONICS

Multi-Process and Multi-Thread Programming

Pinaki Ranjan Sarkar


February 29, 2016

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

You might also like