Phase 4

You might also like

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

Phase 4 Report: Enhancing Scheduling Capabilities

Introduction:
Phase 4 of our project aims to further elevate functionality of remote CLI shell by
introducing the scheduling capabilities in server. This enhancement stimulates the role
of scheduler, providing concurrency for serving the multiple clients. Server now
listens to requests from the clients, manages a waiting queue, and employs a
scheduling algorithm to efficiently select and run the processes.

Key Objectives:

 Implementing the waiting queue for the incoming client requests.


 Introducing the scheduling algorithm in order to prioritize and execute the
processes.
 Enhancing server responsiveness and the concurrency.
 Manage three types of threads: main thread, scheduler thread, and the client
threads.

Implementation Details:

1. Waiting Queue:
Waiting queue is introduced in order to handle incoming client requests. This queue
serves as a holding area for processes, allowing server in order to manage and
prioritize their execution.

2. Scheduling Algorithm:
Scheduling algorithm combines Round Robin with Short-Remaining-Job-First
prioritization in a selectively preemptive manner. The following specifics are
implemented:

 Use a selectively preemptive Round Robin algorithm with the different quantums.
 Start with the short quantum for the first round, followed by the longer quantum
for subsequent rounds.
 Prioritize processes with Short-Remaining-Job-First in order to ensure the
efficient execution.
 Consider a round completed even if the process is preempted before its quantum
is finished.
 Assign a burst time of -1 to shell commands for the immediate execution.
 Utilizing First-Come-First-Served algorithm when remaining burst times are
equal.
 Prevent selecting same process consecutively unless it is only process left.

3. Thread Management:
Three types of threads are managed within server:

 Main Thread: Accepts the connections from new clients.


 Scheduler Thread: Implements scheduling algorithm, managing the waiting
queue.
 Client Threads: Handle individual client connections and command executions.

4. Handling Multiple Threads:


In order to manage the multiple threads effectively, semaphores are utilized in
addition to waiting queue. Relevant data structures are implemented in order to
support scheduling algorithm.

Testing:

Test Scenario 1 - Concurrent Single Commands:


The three concurrent clients run single commands. The server log showcases detailed
information about the execution of each connected client, including creation, start,
end, etc. In this scenario, we examine execution of three concurrent clients
communicating with the server. Each client sends a single command to server without
preemption. The server processes these commands and provides respective outputs.
‘pwd’ stands for "print working directory." When we run this command, it displays
the current working directory, which is directory we are currently in within the file
system."Client Received message from server on socket 3, here is the message :"
indicates that client has received a message from server on socket 3.
"Server Received message from client on socket 4, here is the message : pwd"
indicates that server has received message from the client on socket 4, and content of
the message is the pwd command.

Conclusion:
The introduction of scheduling capabilities in Phase 4 represents the significant
evolution in remote CLI shell. Server's ability to efficiently manage the multiple
clients, prioritize tasks, and dynamically schedule processes demonstrates enhanced
the concurrency and responsiveness. The implementation of a sophisticated
scheduling algorithm contributes to system's versatility, providing the robust
foundation for handling diverse workloads concurrently. This phase marks a crucial
step towards creating a powerful and scalable remote shell for the users in order to
interact seamlessly with the remote resources.

You might also like