Advance Java Project
Advance Java Project
ON
CPU SCHEDULING AND PROCESS
SYNCHRONIZATION
SUBMITTED
BY
VINIT KALE
1
CERTIFICATE
DEPARTMENT
2
Acknowledgement
I would like to express my special thanks to my sir
MR.D.D.SHELKE
For his able guidance and support in completing this project. I would also like to
extend my gratitude to our principal and HOD providing us With all the faculty
that was required for this project. It also helped me doing lot of research & came
to know many new things I’m really thanking full to them….
3
Abstract
This microproject focuses on the essential topics of
"CPU scheduling and process synchronization"
within operating systems. It provides a concise
exploration of scheduling algorithms and process
synchronization mechanisms. The project aims to
equip students and enthusiasts with practical
knowledge and skills for optimizing system resource
utilization and managing concurrent processes in a
multitasking environment.
4
WEEKLY DIARY
Week Starting date Finish date Details of the activity carried out
No.
Week 01 24/07/2023 30/07/2023 Decided the topic to be chosen
5
Week 08 11/09/2023 17/09/2023 Arranged everything implemented by
imposing proper alignment etc in the
created microproject
6
Index
Sr.no Page
content no
1. INTRODUCTION
3. CPU TERMINOlOGIES
5. PROCESS SYNCHRONIZATION
6. CONCLUSION
7. REFRENCES
7
Process Scheduling and Process Synchronization
Introduction
1.Rationale: -
An operating system performs all the basic tasks like managing files, processes,
and memory. Thus operating system acts as manager of the all resources, i.e.,
resource manager. Thus the operating system becomes an interface between user
and machine. An operating system is defined as a system of software without
which a machine cannot boot. In other words, the operating system is defined as
one of the most important software that drives the hardware as well as software
present on the machine or computer.
3.Literature review: -
The operating system is now being widely used in many of the various modern
applications in recent years, ranging from diabetic monitoring to other strategic
planning. The main function of any OS is to control and coordinate all hardware
resources among the commands of the same/different user which increases the
efficiency of advanced comprehensive applications. In an autonomous computer
system CPU is one of the important resources to manage and process all
activities which require scheduling techniques on a processor. Since the early
day of computing and other multiprogramming OS, various studies have been
assigned to CPU scheduling techniques based on processes management and
performance evaluation.
Process synchronization is a way to coordinate processes that use shared data. It
occurs in an operating system among cooperating processes. Cooperating
processes are processes that share resources. While executing many concurrent
processes, process synchronization helps to maintain shared data consistency
and cooperating process execution.
1. CPU Scheduling:
CPU Scheduling is a process of determining which process will own CPU for
execution while another process is on hold. The main task of CPU scheduling is
to make sure that whenever the CPU remains idle, the OS at least selects one of
8
the processes available in the ready queue for execution. The selection process
will be carried out by the CPU scheduler. It selects one of the processes in
memory that are ready for execution.
There are 2 types of CPU Scheduling: -
i. Pre-emptive Scheduling ii. Non-
Pre-emptive Scheduling
i. Pre-emptive Scheduling:
In Pre-emptive Scheduling, the tasks are mostly assigned with their
priorities. Sometimes it is important to run a task with a higher
priority before another lower priority task, even if the lower priority
task is still running. The lower priority task holds for some time and
resumes when the higher priority task finishes its execution.
9
iii. Finish Time: when the process is complete and exits from a system iv.
Multiprogramming: A number of programs that can be present in
memory at the same time.
v. Jobs: It is a type of program without any kind of user interaction.
vi. User: It is a kind of program having user interaction. vii.
Process: It is the reference that is used for both job and user.
viii. CPU/IO burst cycle: Characterizes process execution, which alternates
between CPU and I/O activity. CPU times are usually shorter than the
time of I/O.
10
a. It is associated with each job as a unit of time to complete.
b. In this method, when the CPU is available, the next process or job
with the shortest completion time will be executed first.
c. It is Implemented with a non-pre-emptive policy.
d. This algorithm method is useful for batch-type processing, were
waiting for jobs to complete is not critical. It improves job output
by offering shorter jobs, which should be executed first, which
mostly have a shorter turnaround time.
11
i. Round robin is the oldest, simplest scheduling algorithm. The name of
this algorithm comes from the round-robin principle, where each
person gets an equal share of something in turn.
ii. It is mostly used for scheduling algorithms in multitasking. This
algorithm method helps for starvation-free execution of processes.
iii. Characteristics of Round-Robin Scheduling
12
b. Progress: If no process is executing in the critical section and other
processes are waiting outside the critical section, then only those
processes that are not executing in their remainder section can participate
in deciding which will enter in the critical section next, and the selection
cannot be postponed indefinitely.
c. Bounded Waiting: A bound must exist on the number of times that other
processes are allowed to enter their critical sections after a process has
made a request to enter its critical section and before that request is
granted.
13
iv. Synchronization Hardware:
1. Many systems provide hardware support for critical section code. The
critical section problem could be solved easily in a single-processor
environment if we could disallow interrupts to occur while a shared
variable or resource is being modified.
2. In this manner, we could be sure that the current sequence of instructions
would be allowed to execute in order without pre-emption. Unfortunately,
this solution is not feasible in a multiprocessor environment.
3. Disabling interrupt on a multiprocessor environment can be time-
consuming as the message is passed to all the processors.
4. This message transmission lag delays the entry of threads into the critical
section, and the system efficiency decrease
14
6. Actual Resources Used:
Sr.No. Name of Resources Specifications Qty Remarks
1. Desktop/Laptop Intel i5 5th gen 8GB RAM 1 -
15
CONCLUSION
This project has provided us with practical skills and insights necessary to
address real-world operating system challenges. Mastery of CPU scheduling and
process synchronization principles is pivotal for developing efficient and robust
software systems, making a substantial contribution to our knowledge in
computer science and system engineering.
16
REFERENCE
https://www.geeksforgeeks.org/
https://www.tutorialspoint.com/
17
18