Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Department of Computer Engineering

Academic Term : January - May 2024

Class: B.E. (Computer) Semester VIII


Division: A Subject Name: Distributed Systems CSC 801

Experiment No 1
Roll No 9225

Name of Student Sankalp Rane

Aim: To implement multithreaded client server

Code:

Client.java

Server.java
Output:
Conclusion:

In conclusion , our experiment underscores the advantages of employing a multithreaded client-server


architecture. It enhances scalability, responsiveness, and resource utilization. By concurrently managing
multiple client requests, we've boosted system efficiency. Multithreading facilitates smooth
communication between clients and servers while efficiently handling simultaneous requests.
Furthermore, it optimizes resource usage, leading to improved overall throughput and responsiveness.
This experiment underscores how multithreading effectively builds robust, scalable client-server systems
adept at meeting real-world demands efficiently.

Post Lab Assignment:

1. What are the advantages of a Multithreaded Server?

Improved Performance: It can handle multiple tasks simultaneously, making the server faster.
Enhanced Responsiveness: It can respond to requests from different clients at the same time.
Better Resource Utilization:It efficiently uses system resources like CPU and memory.
Scalability: It can easily accommodate more clients without significant performance degradation.
Simplified Programming:It simplifies the coding process by allowing different tasks to run concurrently in
separate threads.
Reliability:Even if one thread encounters an issue, other threads can continue to operate, ensuring the
server remains functional.

2. With an example, explain the concept of multithreaded clients

Example while using a messaging app where you can chat with friends. In a regular setup, when you
send a message, the app might freeze until it's sent, meaning you can't do anything else. Now, think
of a multithreaded setup:
Sending Messages:Instead of freezing, a separate helper works to send your message while you keep
using the app. It handles the whole sending process without stopping you.
Receiving Messages: When a friend sends you a message, another helper jumps in to get it for you. This
way, you can get messages without waiting, even while sending your own.
Doing Multiple Things:With helpers, the app can do lots of things at once. For example, it can send
messages, get messages, and let you use the app, all without slowing down.
So, with multithreading, the app can handle many tasks at the same time, like sending and getting
messages, making it faster and smoother for you to chat with friends.

You might also like