SlideShare a Scribd company logo
Operating System
Topics
• Thread vs Process
• Pre-emptive vs Non-pre-emptive
• Scheduler vs Dispatcher
• CPU Scheduling Policies
What is OS?
• Operating System as a Resource Manager
- It manages computer hardware and software resources.
• An Operating System (OS) is an interface between a user and hardware.
Functions of Operating System:
• Memory Management
• Processor Management
• Device Management
• File Management
Microsoft Windows
• Microsoft created the Windows operating system in the mid-1980s. Over the years, there
have been many different versions of Windows, but the most recent ones are Windows
10 (released in 2015), Windows 8 (2012).
Mac OS X
• Mac OS is a line of operating systems created by Apple. It comes preloaded on all new
Macintosh computers, or Macs.
• Mac OS X users account for less than 10% of global operating systems—much lower than
the percentage of Windows users (more than 80%).
• One reason for this is that Apple computers tend to be more expensive. However, many
people do prefer the look and feel of Mac OS X over Windows.
Linux
• Linux is a family of open-source operating systems, which means they can be modified
and distributed by anyone around the world. This is different from proprietary
software like Windows, which can only be modified by the company that owns it. The
advantages of Linux are that it is free, and there are many different distributions—or
versions—you can choose from.
• Linux users account for less than 2% of global operating systems.
• However, most servers run Linux because it's relatively easy to customize.
Five Reasons Linux Beats Windows for Servers
Stability
• Linux systems are well known for their ability to run for years without failure; in fact, many
Linux users have never seen a crash.
• That's great for users of every kind, but it's particularly valuable for small and medium-
sized businesses, for which downtime can have disastrous consequences.
Security
• That's due largely to the fact that Linux, which is based on Unix, was designed from the
start to be a multiuser operating system. Only the administrator, or root user has
administrative privileges, and fewer users and applications have permission to access the
kernel or each other. That keeps everything modular and protected.
• Linux is also innately more secure than Windows is.
• Of course, Linux also gets attacked less frequently by viruses and malware, and
vulnerabilities tend be found and fixed more quickly by its legions of developers and
users.
Hardware
• Windows typically requires frequent hardware upgrades to accommodate its ever-increasing
resource demands whereas Linux is slim, trim, flexible and scalable, and it performs admirably
on just about any computer, regardless of processor or machine architecture.
• Linux can also be easily reconfigured to include only the services needed for your business's
purposes, thus further reducing memory requirements, improving performance and keeping
things even simpler.
Performance:
• While there is some debate about which operating system performs better, in our experience
both perform comparably in low-stress conditions however UNIX servers under high load (which
is what is important) are superior to Windows.
Price:
• Windows cost a significant amount of money; on the other hand, Linux is a free operating
system to download, install and operate. Windows hosting results in being a more expensive
platform.
• The Linux kernel, and the GNU utilities and libraries which accompany it in most distributions,
are entirely free and open source. You can download and install GNU/Linux distributions without
purchase. Some companies offer paid support for their Linux distributions, but the underlying
software is still free to download and install. Microsoft Windows usually costs between $99.00
and $199.00 USD for each licensed copy.
CPU – I/O Burst Cycle
Process execution consists of a cycle of CPU
execution and I/O wait.
Process execution consists of a cycle of CPU
execution and I/O wait.
Process States
Performance metrics for CPU scheduling
• CPU utilization: Percentage of the time that CPU is busy.
• Throughput: Number of processes completed per unit time
• Turnaround time: Time taken by a process for its complete execution.
• Wait time: Time spent waiting in the ready queue.
• Response time: Time interval from submission of job to first response.
• Fairness: Giving each process a fair share of CPU.
Goal:
• Maximize CPU utilization, Throughput, and fairness.
• Minimize turnaround time, waiting time, and response time.
Deterministic modeling example:
• Suppose we have processes A, B, and C,
submitted at time 0
• We want to know the response time, waiting
time, and turnaround time of process A
A B C A B C A C A C Time
response time = 0
+ +wait time
turnaround time
Gantt chart: visualize how processes execute.
Deterministic modeling example
• Suppose we have processes A, B, and C,
submitted at time 0
• We want to know the response time, waiting
time, and turnaround time of process B
A B C A B C A C A C Time
response time
+wait time
turnaround time
Deterministic modeling example
• Suppose we have processes A, B, and C,
submitted at time 0
• We want to know the response time, waiting
time, and turnaround time of process C
A B C A B C A C A C Time
response time
+ ++wait time
turnaround time
Pre-emptive Scheduling Non Pre-emptive Scheduling
Process is allocated to processor for a
fixed time slot.
Process is allocated to processor as long
as it wants.
This occurs when the currently
executing process gives up the CPU
voluntarily. A running process is
executed till completion. It cannot be
interrupted.
Desirable : as it provides better control. Not desirable since one process cannot
monopolize the processor very long.
Requires a clock interrupt to occur at
end of time interval. Proper time slot is
required to be decided.
Process can either :
- Exit
- Or Enter in Ready state
Process can either :
- Exit
- Or Enter in Wait State
Scheduling Queues
• All processes when enters into the system are stored in the job queue.
• Processes in the Ready state are placed in the ready queue.
• Processes waiting for a device to become available are placed in device
queues. There are unique device queues for each I/O device available.
Scheduling Policies
• FIFO (first in, first out) NON-PREEMPTIVE
• Round robin PREEMPTIVE
• SJF (shortest job first) NON-PREEMPTIVE
• SRF (shortest remaining time first) PREEMPTIVE
• Priority Scheduling NON-PREEMPTIVE/PREEMPTIVE
• Multilevel feedback queues
Completely Fair Scheduler
What scheduling algorithms does Linux kernel use?
Multi-Level Feedback Queue Scheduling
 It uses many ready queues and associate a different priority with each queue.
 Different scheduling algorithms for various types of processes.
 The Algorithm chooses to process with highest priority from the occupied queue and run
that process either pre-emptively or non-pre-emptively.
 If the process uses too much CPU time it will moved to a lower-priority queue. Similarly, a
process that wait too long in the lower-priority queue may be moved to a higher-priority
queue may be moved to a highest-priority queue.
Disadvantage in multi level queue scheduling: Starvation of low priority queues.
Multilevel feedback queue scheduling removes this starvation problem as it allows
a process to move between queues.
System processes are OS processes.
In implementing a multilevel feedback queue, there are various parameters that we need to
define:
 The number of queues
 The scheduling algorithm for each queue
 The method used to demote processes to lower priority queues
 The method used to promote processes to a higher priority queue (presumably by some
form of aging)
 The method used to determine which queue a process will enter
Priority Scheduling
• Priority scheduling is a method of scheduling processes based on priority.
• It is often possible that a priority scheduling algorithm can make a low-priority
process wait indefinitely i.e. Starvation
• A remedy to starvation is aging, which is a technique used to gradually increase
the priority of those processes that wait for long periods in the system.
• Priority scheduling can be either of the following:
- Pre-emptive
- Non-pre-emptive
Disadvantage: Convoy Effect (Short Process Behind Long Process)
Convoy effect is slowing down of the whole operating system because of few slow
processes. A slow process is utilizing the CPU keeping the fast process on wait.
Advantage: High Throughput
Disadvantage: Starvation
If the short processes are continually added to the CPU scheduler then waiting time of long
processes will be more.
Shortest Remaining Time First
• Pre-emptive version of SJF.
• Selects the process for execution which has the smallest remaining run time.
• Shortest remaining time is optimal and it mostly gives minimum average
waiting time of processes.
Advantage : High Throughput
: No Starvation
Context Switching
• When CPU switches from one
process to another, then system
must save the state of old process
and load the saved state for the
new process.
• Context Switch time is pure
overhead as the system does no
useful work while switching.
• It is the process of storing and
restoring the state of a process so
that execution can be resumed
from the same point at a later
time.
Thread
• Thread is a LWP (Light Weight Process) and is the basic unit of CPU utilization.
• A thread shares with peer threads its code section, data section and other OS
resources (such as files).
• It comprises of :
- thread ID - stack
- registers set - program counter
Thread Process
A thread is often referred as lightweight
process. A thread is a subset(part) of the
process.
A process is sometime referred as task. A
program in execution is often referred as
process.
A thread can communicate with other thread
(of the same process) directly by using
methods like wait(), notify(), notifyAll().
A process can communicate with other
process by using inter-process
communication.
New threads are easily created. However the creation of new processes
require duplication of the parent process.
Threads have control over the other threads
of the same process.
A process does not have control over the
sibling process, it has control over its child
processes only.
A thread uses the process’s address space
and share it with the other threads of that
process.
Each process has its own address space.
No overhead while switching. Significant amount of overhead while
switching.
Any change in main thread (cancellation,
priority change, etc...) may affect the
behaviour of the other threads of the
process. Threads are dependent.
Any change in the parent process does not
affect child processes.
Processes are independent.
There are two types of threads :
• User Threads
• Kernel Threads
• User threads, are above the kernel and without kernel support. These are the threads that
application programmers use in their programs.
• Kernel threads are supported within the kernel of the OS itself. All modern OSs support
kernel level threads, allowing the kernel to perform multiple simultaneous tasks and/or to
service multiple kernel system calls simultaneously.
Problem With Concurrent Execution
• Concurrent processes (or threads) often need to share data (maintained either in shared
memory or files) and resources.
• If there is no controlled access to shared data, some processes will obtain an inconsistent
view of this data.
• The action performed by concurrent processes will then depend on the order in which
their execution is interleaved.
Race Condition
• Situations like this where processes access the same resource concurrently and
the outcome of execution depends on the particular order in which the access
takes place is called a race condition.
• Critical section (CS) is a section of code where multiple threads access the same
resource concurrently and where the sequence of execution for the threads
makes a difference in the result.
• How must the processes coordinate (or synchronise) in order to guard against
race conditions?
Critical Section and Mutual Exclusion
• When a process executes code that manipulates shared data (or resource), we
say that the process is in it’s critical section (CS) (for that shared data).
• Mutual Exclusion: The execution of critical sections must be mutually exclusive:
at any time, only one process is allowed to execute in its critical section (even
with multiple CPUs).
• Then each process must request the permission to enter it’s critical section (CS).
Solution to the critical section problem/Avoiding Race Condition
• Mutual Exclusion
• At any time, at most one process can be in its critical section (CS)
• Bounded Waiting
• There must exist a bound on the number of times that the other processes are allowed to
enter their CS after a process has made a request to enter it’s CS and before that request is
granted.
• otherwise the process will suffer from starvation
• Progress
• Only processes that are not executing in their CS can participate in the decision of who will
enter next in the CS. This selection cannot be postponed indefinitely.
• Hence, we must have no deadlock
Deadlock
• Deadlocks are a set of blocked processes each process is holding a resource and
waiting to acquire a resource held by another process.
• Mutual exclusion condition
A resource cannot be used by more than one process at a time.
• Hold and wait condition
Processes already holding resources may request for new resources.
• No pre-emption condition
Only a process holding a resource may release it.
• Circular wait condition
Two or more processes form a circular chain where each process waits
for a resource that the next process in the chain holds.
• Ignore Deadlock
• Deadlock Prevention
• Deadlock Recovery
Deadlock Prevention
Mutual Exclusion
• Not always possible to prevent deadlock by preventing mutual exclusion (making all resources
shareable) as certain resources are cannot be shared safely. Resources such as printers
requires exclusive access by a single process.
Hold and Wait
We will see two approaches, but both have their disadvantages.
1. A resource gets all required resources before it start execution. This will avoid
deadlock, but will result in reduced throughput as resources are held by
processes even when they are not needed. They could have been used by other
processes during this time.
2. Second approach is to request for a resource only when its free.
This may result in a starvation as all required resources might not be available freely
always.
No pre-emption
1. Allow pre-emption: Steal the resource.
2. Release all other resources before requesting for a resource which is not readily
available.
Circular Wait
To avoid circular wait, resources may be ordered and we can ensure that each process can
request resources only in an increasing order of these numbers. The algorithm may itself
increase complexity and may also lead to poor resource utilization.
Deadlock Recovery
• Once a deadlock is detected, you will have to break the deadlock.
• It can be done through different ways :
- Pre-emption : We can take a resource from one process and give it to other. This
will resolve the deadlock situation, but sometimes it does causes problems.
- Rollback : System can periodically make a record of the state of each process and
when deadlock occurs, roll everything back to the last checkpoint, and restart,
but allocating resources differently so that deadlock does not occur.
- Kill one or more processes - This is the simplest way, but it works. Aborting one or
more processes to break the circular wait condition causing the deadlock.
Semaphore
• A semaphore is a protected integer variable that can facilitate and restrict access to
shared resources in a multi-processing environment.
Two kinds of semaphores:
• Binary semaphores : They represent two possible states (generally 0 or 1; locked or
unlocked).
• Counting semaphores : Counting semaphores represent multiple resources.
How to solve CS problem with semaphore?
A semaphore can only be accessed using the following operations: wait() and signal().
• WAIT: wait() is called when a process wants access to a resource. If semaphore is zero,
that process must wait until it becomes available. The wait command
decrements the semaphore value by 1.
• SIGNAL: signal() is called when a process is done using a resource. The signal operation
increments the semaphore value by 1.
EXPLANATION
• In this implementation, a process wanting to enter its critical section it has to acquire the
binary semaphore which will then give it mutual exclusion until it signals that it is done.
• For example: we have semaphores, and two processes, P1 and P2 that want to enter their
critical sections at the same time. P1 first calls wait(s). The value of s is decremented to 0
and P1 enters its critical section.
• While P1 is in its critical section, P2 calls wait(s), but because the value of s is zero, it must
wait until P1 finishes its critical section and executes signal(s). When P1 calls signal, the
value of s is incremented to 1, and P2 can then proceed to execute in its critical section
(after decrementing the semaphore again).
• Mutual exclusion is achieved because only one process can be in its critical section at any
time.
Producer Consumer Problem (Also known as the
bounded-buffer problem)
• In computing, the producer–consumer problem is a classic example of a multi-process
synchronization problem. The problem describes two processes, the producer and the
consumer, which share a common, fixed-size buffer used as a queue.
- Producer’s job is to generate data, put it into the buffer. (At one go, one item).
- Consumer’s job is to consuming the data (i.e. removing it from the buffer).
3 Problems/Objectives:
- Producers can store only when there is an empty slot. We have to make sure that
the producer won’t try to add data into the buffer if it’s full.
- Consumers can remove only when there is a full slot. We have to make sure that
the consumer won’t try to remove data from an empty buffer.
- We have to set co-ordination between producer and consumer to avoid clash.
Mutual Exclusion has to be set.
Solution
• The producer can go to sleep if the buffer is full. The next time the consumer removes an
item from the buffer, it notifies the producer, who starts to fill the buffer again. In the
same way, the consumer can go to sleep if it finds the buffer to be empty. The next time
the producer puts data into the buffer, it wakes up the sleeping consumer.
An inadequate solution could result in a deadlock where both processes
are waiting to be awakened.
/* wait for an empty space */
Check for overflow.
/* wait for a stored item */
Check for underflow.
Provides Mutual Exclusion for CS
• We have solved the problem using three semaphores.
INITIALIZATION:
• shared binary semaphore mutex = 1;
• shared counting semaphore empty = MAX;
• shared counting semaphore full = 0;
The counting semaphore empty keeps track of “empty slots”, and the
counting semaphore full keeps track of “full slots”.
Mutex vs Semaphore
Mutex vs Semaphore
Using Mutex:
• A mutex provides mutual exclusion, either producer or consumer can have the key (mutex)
and proceed with their work. As long as the buffer is filled by producer, the consumer
needs to wait, and vice versa.
• At any point of time, only one thread can work with the entire buffer. The concept can be
generalized using semaphore.
Using Semaphore:
• A semaphore is a generalized mutex. In lieu of single buffer, we can split the 4 KB buffer
into four 1 KB buffers (identical resources). A semaphore can be associated with these four
buffers. The consumer and producer can work on different buffers at the same time.
Strictly speaking, a mutex is locking mechanism and
Semaphore is signalling mechanism.
Virtual Memory
• A computer can address more memory than the amount physically installed on the
system. This extra memory is actually called virtual memory and it is a section of a hard
disk that's set up to emulate the computer's RAM.
• The main visible advantage of this scheme is that programs can be larger than physical
memory.
• Virtual memory serves two purposes :
- First, it allows us to extend the use of physical memory by using disk.
- Second, it allows us to have memory protection, because each virtual
address is translated to a physical address.
Paging
• Paging technique plays an important role in implementing virtual memory.
• With paging, the address space of process is divided into a sequence of fixed size units called
“pages”
• Similarly, main memory is divided into small fixed-sized blocks of (physical) memory called
“frames” and the size of a frame is kept the same as that of a page to have optimum utilization
of the main memory and to avoid external fragmentation.
• Then when a process is loaded it gets divided into pages which are the same size as those
frames. Pages are then loaded into the frames.
Advantage:
• Paging is a memory management mechanism that allows the physical address space of a
process to be non-contagious.
Demand Paging
• Demand paging follows that pages should only be brought into memory if the
executing process demands them.
Disadvantages :
Memory management with page
replacement algorithms becomes slightly
more complex.
Thrashing which may occur due to
repeated page faults.
Thrashing
• Now if it happens that your system has to swap pages at such a higher rate
that major chunk of CPU time is spent in swapping then this state is known as
thrashing. So effectively during thrashing, the CPU spends less time in some
actual productive work and more time in swapping.
Address Translation
• Page address is called logical address and represented by page number and the offset.
Logical Address = Page number + page offset
• Frame address is called physical address and represented by a frame number and the
offset.
Physical Address = Frame number + page offset
• A data structure called page map table is used to keep track of the relation between a
page of a process to a frame in physical memory.
Advantages and Disadvantages of Paging
• Paging reduces external fragmentation, but still suffer from internal fragmentation.
• Paging is simple to implement and assumed as an efficient memory management
technique.
• Due to equal size of the pages and frames, swapping becomes very easy.
• Page table requires extra memory space, so may not be good for a system having small
RAM.
Secondary vs Primary Memory
Secondary memory consists of all permanent
or persistent storage devices, such as read-
only memory (ROM), HDD, and other types of
internal/external storage media.
External vs Internal Fragmentation
• External fragmentation
Total memory space is enough to satisfy a request or to reside a process in it, but it
is not contiguous so it can not be used. It happens when the memory allocator
leaves sections of unused memory blocks between portions of allocated memory.
• Internal fragmentation
Memory block assigned to process is bigger. Some portion of memory is left
unused as it can not be used by another process.
This usually happens because the processor’s design stipulates that memory must
be cut into blocks of certain sizes -- for example, blocks may be required to be
evenly be divided by four, eight or 16 bytes. When this occurs, a client that needs
57 bytes of memory, for example, may be allocated a block that contains 60 bytes,
or even 64. The extra bytes that the client doesn’t need go to waste,
Memory allocator leaves sections of unused
memory blocks between portions of allocated
memory.
• http://www.studytonight.com/operating-system/memory-management
• https://www.tutorialspoint.com/operating_system/os_process_scheduling.htm
• http://slideplayer.com/slide/5054469/
• http://slideplayer.com/slide/5265444/
• http://slideplayer.com/slide/4802264/

More Related Content

What's hot

Operating system overview concepts ppt
Operating system overview concepts pptOperating system overview concepts ppt
Operating system overview concepts ppt
RajendraPrasad Alladi
 
operating system
operating systemoperating system
operating system
Ibbad shah
 
Principles of operating system
Principles of operating systemPrinciples of operating system
Principles of operating system
Anil Dharmapuri
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating System
Imtiaz Ahmed
 
Introduction to operating syatem
Introduction to operating syatemIntroduction to operating syatem
Introduction to operating syatem
Rafi Dar
 
Basic of operating system
Basic of operating systemBasic of operating system
Basic of operating system
priyanka jain
 
Operating Systems
Operating Systems Operating Systems
Operating Systems
Fahad Shaikh
 
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURESOPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
priyasoundar
 
Silberschatz / OS Concepts
Silberschatz /  OS Concepts Silberschatz /  OS Concepts
Silberschatz / OS Concepts Alanisca Alanis
 
Types or evolution of operating system
Types or evolution of operating systemTypes or evolution of operating system
Types or evolution of operating system
Ekta Bafna
 
Operating system
Operating systemOperating system
Operating system
yogitamore3
 
Operating system and its functions
Operating system and its functionsOperating system and its functions
Operating system and its functions
Namarta Chawla
 
Operating system notes
Operating system notesOperating system notes
Operating system notesSANTOSH RATH
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating System
Soumit Ghosh
 
Operating system
Operating systemOperating system
Operating system
fasalsial1fasalsial1
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system concepts
Starlee Lathong
 
introduction To Operating System
introduction To Operating Systemintroduction To Operating System
introduction To Operating SystemLuka M G
 
Operating System
Operating System Operating System
Operating System
Jubayer Alam Shoikat
 
introduction to operating system
introduction to operating systemintroduction to operating system
introduction to operating system
HAMZA AHMED
 

What's hot (20)

Operating system overview concepts ppt
Operating system overview concepts pptOperating system overview concepts ppt
Operating system overview concepts ppt
 
operating system
operating systemoperating system
operating system
 
Principles of operating system
Principles of operating systemPrinciples of operating system
Principles of operating system
 
Introduction to Operating System
Introduction to Operating SystemIntroduction to Operating System
Introduction to Operating System
 
Introduction to operating syatem
Introduction to operating syatemIntroduction to operating syatem
Introduction to operating syatem
 
Basic of operating system
Basic of operating systemBasic of operating system
Basic of operating system
 
Operating Systems
Operating Systems Operating Systems
Operating Systems
 
An Introduction to Operating Systems
An Introduction to Operating SystemsAn Introduction to Operating Systems
An Introduction to Operating Systems
 
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURESOPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
 
Silberschatz / OS Concepts
Silberschatz /  OS Concepts Silberschatz /  OS Concepts
Silberschatz / OS Concepts
 
Types or evolution of operating system
Types or evolution of operating systemTypes or evolution of operating system
Types or evolution of operating system
 
Operating system
Operating systemOperating system
Operating system
 
Operating system and its functions
Operating system and its functionsOperating system and its functions
Operating system and its functions
 
Operating system notes
Operating system notesOperating system notes
Operating system notes
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating System
 
Operating system
Operating systemOperating system
Operating system
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system concepts
 
introduction To Operating System
introduction To Operating Systemintroduction To Operating System
introduction To Operating System
 
Operating System
Operating System Operating System
Operating System
 
introduction to operating system
introduction to operating systemintroduction to operating system
introduction to operating system
 

Viewers also liked

Process in operating system
Process in operating systemProcess in operating system
Process in operating system
Chetan Mahawar
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
Karan Thakkar
 
3 process management
3 process management3 process management
3 process management
Dr. Loganathan R
 
Processes Control Block (Operating System)
Processes Control Block (Operating System)Processes Control Block (Operating System)
Processes Control Block (Operating System)Imdad Ullah
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
Dr. Loganathan R
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresWayne Jones Jnr
 
Functions Of Operating System
Functions Of Operating SystemFunctions Of Operating System
Functions Of Operating System
Dr.Suresh Isave
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)Vaibhav Bajaj
 
Operating system 11.10.2016 adarsh bang
Operating system 11.10.2016 adarsh bangOperating system 11.10.2016 adarsh bang
Operating system 11.10.2016 adarsh bang
adarshbang1998
 
Jireh ict
Jireh ictJireh ict
Jireh ict
Mountain Zion
 
Docker & Badoo: 
никогда не останавливайся на достигнутом
Docker & Badoo: 
никогда не останавливайся на достигнутомDocker & Badoo: 
никогда не останавливайся на достигнутом
Docker & Badoo: 
никогда не останавливайся на достигнутом
Anton Turetsky
 
Linux O(1) Scheduling
Linux O(1) SchedulingLinux O(1) Scheduling
Linux O(1) Scheduling
Roy Lee
 
Intro to cluster scheduler for Linux containers
Intro to cluster scheduler for Linux containersIntro to cluster scheduler for Linux containers
Intro to cluster scheduler for Linux containers
Kumar Gaurav
 
LCU13: Power-efficient scheduling, and the latest news from the kernel summit
LCU13: Power-efficient scheduling, and the latest news from the kernel summitLCU13: Power-efficient scheduling, and the latest news from the kernel summit
LCU13: Power-efficient scheduling, and the latest news from the kernel summit
Linaro
 
Process Scheduling
Process SchedulingProcess Scheduling
React native
React nativeReact native
React native
Liran Ben Haim
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.
Shreya Kumar
 
Unit 4
Unit  4Unit  4
Unit 4
pm_ghate
 

Viewers also liked (20)

Process in operating system
Process in operating systemProcess in operating system
Process in operating system
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
 
3 process management
3 process management3 process management
3 process management
 
Processes Control Block (Operating System)
Processes Control Block (Operating System)Processes Control Block (Operating System)
Processes Control Block (Operating System)
 
5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System Structures
 
Functions Of Operating System
Functions Of Operating SystemFunctions Of Operating System
Functions Of Operating System
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
Presentation on operating system
 Presentation on operating system Presentation on operating system
Presentation on operating system
 
Operating system 11.10.2016 adarsh bang
Operating system 11.10.2016 adarsh bangOperating system 11.10.2016 adarsh bang
Operating system 11.10.2016 adarsh bang
 
Jireh ict
Jireh ictJireh ict
Jireh ict
 
Docker & Badoo: 
никогда не останавливайся на достигнутом
Docker & Badoo: 
никогда не останавливайся на достигнутомDocker & Badoo: 
никогда не останавливайся на достигнутом
Docker & Badoo: 
никогда не останавливайся на достигнутом
 
Chapter03
Chapter03Chapter03
Chapter03
 
Linux O(1) Scheduling
Linux O(1) SchedulingLinux O(1) Scheduling
Linux O(1) Scheduling
 
Intro to cluster scheduler for Linux containers
Intro to cluster scheduler for Linux containersIntro to cluster scheduler for Linux containers
Intro to cluster scheduler for Linux containers
 
LCU13: Power-efficient scheduling, and the latest news from the kernel summit
LCU13: Power-efficient scheduling, and the latest news from the kernel summitLCU13: Power-efficient scheduling, and the latest news from the kernel summit
LCU13: Power-efficient scheduling, and the latest news from the kernel summit
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
React native
React nativeReact native
React native
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.
 
Unit 4
Unit  4Unit  4
Unit 4
 

Similar to Insider operating system

PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptx
DivyaKS18
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
chnrketan
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & Applications
Maulen Bale
 
Operating System
Operating SystemOperating System
Operating System
Hitesh Mohapatra
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .
nathansel1
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
Fahad Farooq
 
Lecture- 2_Process Management.pdf
Lecture- 2_Process Management.pdfLecture- 2_Process Management.pdf
Lecture- 2_Process Management.pdf
Harika Pudugosula
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
nikhil287188
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
VAIBHAVSAHU55
 
Operating System Components.pptx
Operating System Components.pptxOperating System Components.pptx
Operating System Components.pptx
pkavithascs
 
CSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptxCSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptx
akhilagajjala
 
Unit 2_OS process management
Unit 2_OS process management Unit 2_OS process management
Unit 2_OS process management
JayeshGadhave1
 
MK Sistem Operasi.pdf
MK Sistem Operasi.pdfMK Sistem Operasi.pdf
MK Sistem Operasi.pdf
wisard1
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
FahanaAbdulVahab
 
1. Introduction to OS.ppt
1. Introduction to OS.ppt1. Introduction to OS.ppt
1. Introduction to OS.ppt
SATHYABAMAMADHANKUMA
 
Processes and operating systems
Processes and operating systemsProcesses and operating systems
Processes and operating systems
RAMPRAKASHT1
 
Introduction to operating systems
 Introduction to operating systems Introduction to operating systems
Introduction to operating systems
Kumbirai Junior Muzavazi
 
Module2 MultiThreads.ppt
Module2 MultiThreads.pptModule2 MultiThreads.ppt
Module2 MultiThreads.ppt
shreesha16
 
Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...
ApurvaLaddha
 
UNIT 1 - UNDERSTANDINGTHE PRINCIPLES OF OPERATING SYSTEM.pptx
UNIT 1 - UNDERSTANDINGTHE PRINCIPLES OF OPERATING SYSTEM.pptxUNIT 1 - UNDERSTANDINGTHE PRINCIPLES OF OPERATING SYSTEM.pptx
UNIT 1 - UNDERSTANDINGTHE PRINCIPLES OF OPERATING SYSTEM.pptx
LeahRachael
 

Similar to Insider operating system (20)

PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptx
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & Applications
 
Operating System
Operating SystemOperating System
Operating System
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
 
Lecture- 2_Process Management.pdf
Lecture- 2_Process Management.pdfLecture- 2_Process Management.pdf
Lecture- 2_Process Management.pdf
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
 
Operating System Components.pptx
Operating System Components.pptxOperating System Components.pptx
Operating System Components.pptx
 
CSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptxCSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptx
 
Unit 2_OS process management
Unit 2_OS process management Unit 2_OS process management
Unit 2_OS process management
 
MK Sistem Operasi.pdf
MK Sistem Operasi.pdfMK Sistem Operasi.pdf
MK Sistem Operasi.pdf
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 
1. Introduction to OS.ppt
1. Introduction to OS.ppt1. Introduction to OS.ppt
1. Introduction to OS.ppt
 
Processes and operating systems
Processes and operating systemsProcesses and operating systems
Processes and operating systems
 
Introduction to operating systems
 Introduction to operating systems Introduction to operating systems
Introduction to operating systems
 
Module2 MultiThreads.ppt
Module2 MultiThreads.pptModule2 MultiThreads.ppt
Module2 MultiThreads.ppt
 
Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...
 
UNIT 1 - UNDERSTANDINGTHE PRINCIPLES OF OPERATING SYSTEM.pptx
UNIT 1 - UNDERSTANDINGTHE PRINCIPLES OF OPERATING SYSTEM.pptxUNIT 1 - UNDERSTANDINGTHE PRINCIPLES OF OPERATING SYSTEM.pptx
UNIT 1 - UNDERSTANDINGTHE PRINCIPLES OF OPERATING SYSTEM.pptx
 

Recently uploaded

Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
An Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering TechniquesAn Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering Techniques
ambekarshweta25
 
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABSDESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
itech2017
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
zwunae
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 

Recently uploaded (20)

Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
An Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering TechniquesAn Approach to Detecting Writing Styles Based on Clustering Techniques
An Approach to Detecting Writing Styles Based on Clustering Techniques
 
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABSDESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
DESIGN AND ANALYSIS OF A CAR SHOWROOM USING E TABS
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 

Insider operating system

  • 2. Topics • Thread vs Process • Pre-emptive vs Non-pre-emptive • Scheduler vs Dispatcher • CPU Scheduling Policies
  • 3. What is OS? • Operating System as a Resource Manager - It manages computer hardware and software resources. • An Operating System (OS) is an interface between a user and hardware. Functions of Operating System: • Memory Management • Processor Management • Device Management • File Management
  • 4. Microsoft Windows • Microsoft created the Windows operating system in the mid-1980s. Over the years, there have been many different versions of Windows, but the most recent ones are Windows 10 (released in 2015), Windows 8 (2012).
  • 5. Mac OS X • Mac OS is a line of operating systems created by Apple. It comes preloaded on all new Macintosh computers, or Macs. • Mac OS X users account for less than 10% of global operating systems—much lower than the percentage of Windows users (more than 80%). • One reason for this is that Apple computers tend to be more expensive. However, many people do prefer the look and feel of Mac OS X over Windows.
  • 6. Linux • Linux is a family of open-source operating systems, which means they can be modified and distributed by anyone around the world. This is different from proprietary software like Windows, which can only be modified by the company that owns it. The advantages of Linux are that it is free, and there are many different distributions—or versions—you can choose from. • Linux users account for less than 2% of global operating systems. • However, most servers run Linux because it's relatively easy to customize.
  • 7. Five Reasons Linux Beats Windows for Servers Stability • Linux systems are well known for their ability to run for years without failure; in fact, many Linux users have never seen a crash. • That's great for users of every kind, but it's particularly valuable for small and medium- sized businesses, for which downtime can have disastrous consequences. Security • That's due largely to the fact that Linux, which is based on Unix, was designed from the start to be a multiuser operating system. Only the administrator, or root user has administrative privileges, and fewer users and applications have permission to access the kernel or each other. That keeps everything modular and protected. • Linux is also innately more secure than Windows is. • Of course, Linux also gets attacked less frequently by viruses and malware, and vulnerabilities tend be found and fixed more quickly by its legions of developers and users.
  • 8. Hardware • Windows typically requires frequent hardware upgrades to accommodate its ever-increasing resource demands whereas Linux is slim, trim, flexible and scalable, and it performs admirably on just about any computer, regardless of processor or machine architecture. • Linux can also be easily reconfigured to include only the services needed for your business's purposes, thus further reducing memory requirements, improving performance and keeping things even simpler. Performance: • While there is some debate about which operating system performs better, in our experience both perform comparably in low-stress conditions however UNIX servers under high load (which is what is important) are superior to Windows. Price: • Windows cost a significant amount of money; on the other hand, Linux is a free operating system to download, install and operate. Windows hosting results in being a more expensive platform. • The Linux kernel, and the GNU utilities and libraries which accompany it in most distributions, are entirely free and open source. You can download and install GNU/Linux distributions without purchase. Some companies offer paid support for their Linux distributions, but the underlying software is still free to download and install. Microsoft Windows usually costs between $99.00 and $199.00 USD for each licensed copy.
  • 9.
  • 10. CPU – I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait.
  • 11. Process execution consists of a cycle of CPU execution and I/O wait.
  • 13. Performance metrics for CPU scheduling • CPU utilization: Percentage of the time that CPU is busy. • Throughput: Number of processes completed per unit time • Turnaround time: Time taken by a process for its complete execution. • Wait time: Time spent waiting in the ready queue. • Response time: Time interval from submission of job to first response. • Fairness: Giving each process a fair share of CPU. Goal: • Maximize CPU utilization, Throughput, and fairness. • Minimize turnaround time, waiting time, and response time.
  • 14. Deterministic modeling example: • Suppose we have processes A, B, and C, submitted at time 0 • We want to know the response time, waiting time, and turnaround time of process A A B C A B C A C A C Time response time = 0 + +wait time turnaround time Gantt chart: visualize how processes execute.
  • 15. Deterministic modeling example • Suppose we have processes A, B, and C, submitted at time 0 • We want to know the response time, waiting time, and turnaround time of process B A B C A B C A C A C Time response time +wait time turnaround time
  • 16. Deterministic modeling example • Suppose we have processes A, B, and C, submitted at time 0 • We want to know the response time, waiting time, and turnaround time of process C A B C A B C A C A C Time response time + ++wait time turnaround time
  • 17.
  • 18. Pre-emptive Scheduling Non Pre-emptive Scheduling Process is allocated to processor for a fixed time slot. Process is allocated to processor as long as it wants. This occurs when the currently executing process gives up the CPU voluntarily. A running process is executed till completion. It cannot be interrupted. Desirable : as it provides better control. Not desirable since one process cannot monopolize the processor very long. Requires a clock interrupt to occur at end of time interval. Proper time slot is required to be decided. Process can either : - Exit - Or Enter in Ready state Process can either : - Exit - Or Enter in Wait State
  • 19. Scheduling Queues • All processes when enters into the system are stored in the job queue. • Processes in the Ready state are placed in the ready queue. • Processes waiting for a device to become available are placed in device queues. There are unique device queues for each I/O device available.
  • 20. Scheduling Policies • FIFO (first in, first out) NON-PREEMPTIVE • Round robin PREEMPTIVE • SJF (shortest job first) NON-PREEMPTIVE • SRF (shortest remaining time first) PREEMPTIVE • Priority Scheduling NON-PREEMPTIVE/PREEMPTIVE • Multilevel feedback queues Completely Fair Scheduler What scheduling algorithms does Linux kernel use?
  • 21. Multi-Level Feedback Queue Scheduling  It uses many ready queues and associate a different priority with each queue.  Different scheduling algorithms for various types of processes.  The Algorithm chooses to process with highest priority from the occupied queue and run that process either pre-emptively or non-pre-emptively.  If the process uses too much CPU time it will moved to a lower-priority queue. Similarly, a process that wait too long in the lower-priority queue may be moved to a higher-priority queue may be moved to a highest-priority queue. Disadvantage in multi level queue scheduling: Starvation of low priority queues. Multilevel feedback queue scheduling removes this starvation problem as it allows a process to move between queues.
  • 22. System processes are OS processes.
  • 23. In implementing a multilevel feedback queue, there are various parameters that we need to define:  The number of queues  The scheduling algorithm for each queue  The method used to demote processes to lower priority queues  The method used to promote processes to a higher priority queue (presumably by some form of aging)  The method used to determine which queue a process will enter
  • 24. Priority Scheduling • Priority scheduling is a method of scheduling processes based on priority. • It is often possible that a priority scheduling algorithm can make a low-priority process wait indefinitely i.e. Starvation • A remedy to starvation is aging, which is a technique used to gradually increase the priority of those processes that wait for long periods in the system. • Priority scheduling can be either of the following: - Pre-emptive - Non-pre-emptive
  • 25. Disadvantage: Convoy Effect (Short Process Behind Long Process) Convoy effect is slowing down of the whole operating system because of few slow processes. A slow process is utilizing the CPU keeping the fast process on wait.
  • 26.
  • 27. Advantage: High Throughput Disadvantage: Starvation If the short processes are continually added to the CPU scheduler then waiting time of long processes will be more.
  • 28. Shortest Remaining Time First • Pre-emptive version of SJF. • Selects the process for execution which has the smallest remaining run time. • Shortest remaining time is optimal and it mostly gives minimum average waiting time of processes. Advantage : High Throughput : No Starvation
  • 29. Context Switching • When CPU switches from one process to another, then system must save the state of old process and load the saved state for the new process. • Context Switch time is pure overhead as the system does no useful work while switching. • It is the process of storing and restoring the state of a process so that execution can be resumed from the same point at a later time.
  • 30. Thread • Thread is a LWP (Light Weight Process) and is the basic unit of CPU utilization. • A thread shares with peer threads its code section, data section and other OS resources (such as files). • It comprises of : - thread ID - stack - registers set - program counter
  • 31. Thread Process A thread is often referred as lightweight process. A thread is a subset(part) of the process. A process is sometime referred as task. A program in execution is often referred as process. A thread can communicate with other thread (of the same process) directly by using methods like wait(), notify(), notifyAll(). A process can communicate with other process by using inter-process communication. New threads are easily created. However the creation of new processes require duplication of the parent process. Threads have control over the other threads of the same process. A process does not have control over the sibling process, it has control over its child processes only. A thread uses the process’s address space and share it with the other threads of that process. Each process has its own address space. No overhead while switching. Significant amount of overhead while switching. Any change in main thread (cancellation, priority change, etc...) may affect the behaviour of the other threads of the process. Threads are dependent. Any change in the parent process does not affect child processes. Processes are independent.
  • 32. There are two types of threads : • User Threads • Kernel Threads • User threads, are above the kernel and without kernel support. These are the threads that application programmers use in their programs. • Kernel threads are supported within the kernel of the OS itself. All modern OSs support kernel level threads, allowing the kernel to perform multiple simultaneous tasks and/or to service multiple kernel system calls simultaneously.
  • 33.
  • 34. Problem With Concurrent Execution • Concurrent processes (or threads) often need to share data (maintained either in shared memory or files) and resources. • If there is no controlled access to shared data, some processes will obtain an inconsistent view of this data. • The action performed by concurrent processes will then depend on the order in which their execution is interleaved.
  • 35.
  • 36. Race Condition • Situations like this where processes access the same resource concurrently and the outcome of execution depends on the particular order in which the access takes place is called a race condition. • Critical section (CS) is a section of code where multiple threads access the same resource concurrently and where the sequence of execution for the threads makes a difference in the result. • How must the processes coordinate (or synchronise) in order to guard against race conditions?
  • 37. Critical Section and Mutual Exclusion • When a process executes code that manipulates shared data (or resource), we say that the process is in it’s critical section (CS) (for that shared data). • Mutual Exclusion: The execution of critical sections must be mutually exclusive: at any time, only one process is allowed to execute in its critical section (even with multiple CPUs). • Then each process must request the permission to enter it’s critical section (CS).
  • 38.
  • 39.
  • 40. Solution to the critical section problem/Avoiding Race Condition • Mutual Exclusion • At any time, at most one process can be in its critical section (CS) • Bounded Waiting • There must exist a bound on the number of times that the other processes are allowed to enter their CS after a process has made a request to enter it’s CS and before that request is granted. • otherwise the process will suffer from starvation • Progress • Only processes that are not executing in their CS can participate in the decision of who will enter next in the CS. This selection cannot be postponed indefinitely. • Hence, we must have no deadlock
  • 41. Deadlock • Deadlocks are a set of blocked processes each process is holding a resource and waiting to acquire a resource held by another process.
  • 42. • Mutual exclusion condition A resource cannot be used by more than one process at a time. • Hold and wait condition Processes already holding resources may request for new resources. • No pre-emption condition Only a process holding a resource may release it. • Circular wait condition Two or more processes form a circular chain where each process waits for a resource that the next process in the chain holds.
  • 43. • Ignore Deadlock • Deadlock Prevention • Deadlock Recovery
  • 44. Deadlock Prevention Mutual Exclusion • Not always possible to prevent deadlock by preventing mutual exclusion (making all resources shareable) as certain resources are cannot be shared safely. Resources such as printers requires exclusive access by a single process. Hold and Wait We will see two approaches, but both have their disadvantages. 1. A resource gets all required resources before it start execution. This will avoid deadlock, but will result in reduced throughput as resources are held by processes even when they are not needed. They could have been used by other processes during this time. 2. Second approach is to request for a resource only when its free. This may result in a starvation as all required resources might not be available freely always.
  • 45. No pre-emption 1. Allow pre-emption: Steal the resource. 2. Release all other resources before requesting for a resource which is not readily available. Circular Wait To avoid circular wait, resources may be ordered and we can ensure that each process can request resources only in an increasing order of these numbers. The algorithm may itself increase complexity and may also lead to poor resource utilization.
  • 46. Deadlock Recovery • Once a deadlock is detected, you will have to break the deadlock. • It can be done through different ways : - Pre-emption : We can take a resource from one process and give it to other. This will resolve the deadlock situation, but sometimes it does causes problems. - Rollback : System can periodically make a record of the state of each process and when deadlock occurs, roll everything back to the last checkpoint, and restart, but allocating resources differently so that deadlock does not occur. - Kill one or more processes - This is the simplest way, but it works. Aborting one or more processes to break the circular wait condition causing the deadlock.
  • 47. Semaphore • A semaphore is a protected integer variable that can facilitate and restrict access to shared resources in a multi-processing environment. Two kinds of semaphores: • Binary semaphores : They represent two possible states (generally 0 or 1; locked or unlocked). • Counting semaphores : Counting semaphores represent multiple resources.
  • 48. How to solve CS problem with semaphore? A semaphore can only be accessed using the following operations: wait() and signal(). • WAIT: wait() is called when a process wants access to a resource. If semaphore is zero, that process must wait until it becomes available. The wait command decrements the semaphore value by 1. • SIGNAL: signal() is called when a process is done using a resource. The signal operation increments the semaphore value by 1.
  • 49. EXPLANATION • In this implementation, a process wanting to enter its critical section it has to acquire the binary semaphore which will then give it mutual exclusion until it signals that it is done. • For example: we have semaphores, and two processes, P1 and P2 that want to enter their critical sections at the same time. P1 first calls wait(s). The value of s is decremented to 0 and P1 enters its critical section. • While P1 is in its critical section, P2 calls wait(s), but because the value of s is zero, it must wait until P1 finishes its critical section and executes signal(s). When P1 calls signal, the value of s is incremented to 1, and P2 can then proceed to execute in its critical section (after decrementing the semaphore again). • Mutual exclusion is achieved because only one process can be in its critical section at any time.
  • 50. Producer Consumer Problem (Also known as the bounded-buffer problem) • In computing, the producer–consumer problem is a classic example of a multi-process synchronization problem. The problem describes two processes, the producer and the consumer, which share a common, fixed-size buffer used as a queue. - Producer’s job is to generate data, put it into the buffer. (At one go, one item). - Consumer’s job is to consuming the data (i.e. removing it from the buffer). 3 Problems/Objectives: - Producers can store only when there is an empty slot. We have to make sure that the producer won’t try to add data into the buffer if it’s full. - Consumers can remove only when there is a full slot. We have to make sure that the consumer won’t try to remove data from an empty buffer. - We have to set co-ordination between producer and consumer to avoid clash. Mutual Exclusion has to be set.
  • 51. Solution • The producer can go to sleep if the buffer is full. The next time the consumer removes an item from the buffer, it notifies the producer, who starts to fill the buffer again. In the same way, the consumer can go to sleep if it finds the buffer to be empty. The next time the producer puts data into the buffer, it wakes up the sleeping consumer. An inadequate solution could result in a deadlock where both processes are waiting to be awakened.
  • 52. /* wait for an empty space */ Check for overflow. /* wait for a stored item */ Check for underflow. Provides Mutual Exclusion for CS
  • 53. • We have solved the problem using three semaphores. INITIALIZATION: • shared binary semaphore mutex = 1; • shared counting semaphore empty = MAX; • shared counting semaphore full = 0; The counting semaphore empty keeps track of “empty slots”, and the counting semaphore full keeps track of “full slots”.
  • 55. Mutex vs Semaphore Using Mutex: • A mutex provides mutual exclusion, either producer or consumer can have the key (mutex) and proceed with their work. As long as the buffer is filled by producer, the consumer needs to wait, and vice versa. • At any point of time, only one thread can work with the entire buffer. The concept can be generalized using semaphore. Using Semaphore: • A semaphore is a generalized mutex. In lieu of single buffer, we can split the 4 KB buffer into four 1 KB buffers (identical resources). A semaphore can be associated with these four buffers. The consumer and producer can work on different buffers at the same time. Strictly speaking, a mutex is locking mechanism and Semaphore is signalling mechanism.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60. Virtual Memory • A computer can address more memory than the amount physically installed on the system. This extra memory is actually called virtual memory and it is a section of a hard disk that's set up to emulate the computer's RAM. • The main visible advantage of this scheme is that programs can be larger than physical memory. • Virtual memory serves two purposes : - First, it allows us to extend the use of physical memory by using disk. - Second, it allows us to have memory protection, because each virtual address is translated to a physical address.
  • 61. Paging • Paging technique plays an important role in implementing virtual memory. • With paging, the address space of process is divided into a sequence of fixed size units called “pages” • Similarly, main memory is divided into small fixed-sized blocks of (physical) memory called “frames” and the size of a frame is kept the same as that of a page to have optimum utilization of the main memory and to avoid external fragmentation. • Then when a process is loaded it gets divided into pages which are the same size as those frames. Pages are then loaded into the frames. Advantage: • Paging is a memory management mechanism that allows the physical address space of a process to be non-contagious.
  • 62.
  • 63. Demand Paging • Demand paging follows that pages should only be brought into memory if the executing process demands them. Disadvantages : Memory management with page replacement algorithms becomes slightly more complex. Thrashing which may occur due to repeated page faults.
  • 64.
  • 65. Thrashing • Now if it happens that your system has to swap pages at such a higher rate that major chunk of CPU time is spent in swapping then this state is known as thrashing. So effectively during thrashing, the CPU spends less time in some actual productive work and more time in swapping.
  • 66. Address Translation • Page address is called logical address and represented by page number and the offset. Logical Address = Page number + page offset • Frame address is called physical address and represented by a frame number and the offset. Physical Address = Frame number + page offset • A data structure called page map table is used to keep track of the relation between a page of a process to a frame in physical memory.
  • 67. Advantages and Disadvantages of Paging • Paging reduces external fragmentation, but still suffer from internal fragmentation. • Paging is simple to implement and assumed as an efficient memory management technique. • Due to equal size of the pages and frames, swapping becomes very easy. • Page table requires extra memory space, so may not be good for a system having small RAM.
  • 68. Secondary vs Primary Memory Secondary memory consists of all permanent or persistent storage devices, such as read- only memory (ROM), HDD, and other types of internal/external storage media.
  • 69.
  • 70.
  • 71.
  • 72. External vs Internal Fragmentation • External fragmentation Total memory space is enough to satisfy a request or to reside a process in it, but it is not contiguous so it can not be used. It happens when the memory allocator leaves sections of unused memory blocks between portions of allocated memory. • Internal fragmentation Memory block assigned to process is bigger. Some portion of memory is left unused as it can not be used by another process. This usually happens because the processor’s design stipulates that memory must be cut into blocks of certain sizes -- for example, blocks may be required to be evenly be divided by four, eight or 16 bytes. When this occurs, a client that needs 57 bytes of memory, for example, may be allocated a block that contains 60 bytes, or even 64. The extra bytes that the client doesn’t need go to waste,
  • 73. Memory allocator leaves sections of unused memory blocks between portions of allocated memory.
  • 74. • http://www.studytonight.com/operating-system/memory-management • https://www.tutorialspoint.com/operating_system/os_process_scheduling.htm • http://slideplayer.com/slide/5054469/ • http://slideplayer.com/slide/5265444/ • http://slideplayer.com/slide/4802264/