SlideShare a Scribd company logo
1 of 44
Student’s Name Matric
Number
Aniyah binti Amirhussin B031310042
Azwana binti Ahmad B031310071
Daliah binti Daud B031310491
Goh Yu Fern B031310113
Nik Siti Noor Fadhillah binti Md Saad B031310496
Rahilda Nadhirah Norizzaty binti Rahiddin B031310111
 Also known as task.
 Execution of an individual program.
 Contains program code and its current activity
 Can be traced to list the sequence of instructions that
execute.
Depending on the operating system (OS), a process may
be made up of multiple threads of execution that
execute instructions concurrently.
 While program is executing, processes are stored in
data structure known as PCB.
 PCB is created for each process.
 The creation and management of PCB is done by OS
 PCB has sufficient information. Thus, it’s possible to
interrupt a running process and later resume
execution as if there is no interruption.
Process = Program code + Associated data +
PCB
Change to other value,
For example: blocked or ready
Current values are saved in appropriate
fields of corresponding PCB
OS is now free to put other
process in Running state
 OS program that moves the processor from one
process to another.
 Prevents a single process from monopolizing processor
time.
 Decides who goes next according to a scheduling
algorithm.
 CPU will execute instructions from the dispatcher
while switching from process A to process B.
Process Creation
* Process (parent) creates another process (child) called as
process spawning.
* Submission of batch job and user is logs on.
* It is created to provide service such as printing.
Process Termination
* Batch job issues Halt instruction (OS service call for
termination) and user is logs off.
* Occurs when quitting an application or error and faults
condition appear.
Reasons for Process Termination
* Normal completion
* Time limit exceeded
* Memory unavailable
* Protection error (eg: write to read-only file)
* I/O failure
o Process may be in one of two states: running, not running.
o Dispatcher cannot select the process that is in the queue
the longest because it may be blocked
o Solution: split Not Running into two states:
i) Ready – prepare to execute when given opportunity
ii) Blocked/Waiting – process cannot execute until some
event occurs
3. A Five-State Process Model
4. Suspended Process
 Processor faster than I/O (processes wait for I/O)
 Swap these processes to disk to free up memory
 Block state -> suspend state, when swap to disk
 Two new state
- Blocked, suspend: blocked processes which have
been swapped out to disk
- Ready, suspend: ready processes which have been
swapped out to disk
One Suspend State
Two Suspend State
OS have tables for managing processes and resources.
1. Memory tables
- Allocation of main and secondary memory to
processes
- Protection attributes for access to shared
memory regions
- Information needed to manage virtual memory
2. I/O tables
- I/O device is available or assigned
- Status of I/O operation
- Location in main memory being used as the
source or destination of the I/O transfer
3. File tables
- Existence of files
- Location on secondary memory
- Current Status
- Attributes
- Sometimes this information is maintained by a file-
management system
4. Process tables
- Where process is located
- Attributes necessary for its management
- Process ID
- Process state
- Location in memory
1. Modes of Execution
i. User Mode
* Less-privileged mode
* User programs typically execute in this
mode
ii. System mode, Control mode or Kernel Mode
* More-privileged mode
* Kernel of the OS
2. Process Creation
 Assign a unique process identifier
 Allocate space for the process
 Initialize process control block
 Set up appropriate linkages
Eg: add new process to linked list used for
scheduling queue
 Create or expand other data structures
Eg: maintain an accounting file
 A thread is the smallest unit of processing that can be
performed in an OS.
 An execution state (running, ready, etc.)
 Has an execution stack.
 In most modern operating systems, a thread exists
within a process - that is, a single process may contain
multiple threads.
 On a single processor, multi threading generally occurs
by as in multitasking, the processor switches between
different threads.
 This context switching generally happens frequently
enough that the user perceives the threads or tasks to
be running at the same time.
 On the multiprocessor or mutli-core system, the
threads or task actually do run at the same time, with
each processor or core running a particular thread or
task.
Single and Multithreading Processes
• Multithreading: when OS supports multiple threads of
execution within a single process.
• Single threading: when the OS does not recognize the
concept of thread.
• MS-DOS supports a single thread.
• UNIX supports multiple user processes but only supports one
thread per process
• Windows 2000, Solaris, Linux, Mach, and OS/2 support
multiple threads
Thread Control Block contains a register image, thread priority and thread state information
 Thread minimize context switching time.
 Use of threads provides concurrency within a process.
 Efficient communication.
 Economy- It is more economical to create and context
switch threads.
 Utilization of multiprocessor architectures to a greater
scale and efficiency.
 Three key states: running, ready, blocked
 No suspend state since all threads share the same
address space.
 Suspending a process involves suspending all threads
of the process.
 Termination of a process, terminates all threads
within the process.
 States associated with a change in thread state:
i. Spawn -spawn another thread
ii. Block
iii. Unblock
iv. Finish
 Contains code for:
1. User Level Threads – (user managed thread)
Diagram Of User-level Thread
o All thread management is done by the application.
o The kernel is not aware of the existence of threads.
o OS only schedules the process, not the threads within
process.
o Programmer using a thread library to manage threads
(create,delete,schedule)
User-level threads can be implemented on operating system that does not
support threads.
Implementing user-level threads does not require modification of operating
system where everything is managed by the thread library.
Simple representation which the thread is represented by a the thread ID,
program counter, register, stack , all stored in user process address space.
Simple management where creating new threads, switching threads and
synchronization between threads can be done without intervention of the
kernel.
Fast and efficient where switching thread is much more inexpensive
compared to a system call.
There is a lack of coordination between threads and operating system
kernel. A process gets one time slice no matter it has 1 thread or 10000
threads within it. It is up to the thread itself to give up the control to other
threads.
If one thread made a blocking system call, the entire process can be
blocked in the kernel, even if other threads in the same process are in the
ready state.
2. Kernel-Level Threads
(OS managed threads acting on kernel, an OS core)
 All thread management is done by the kernel.
 Kernel maintains context information for the process
and the threads.
 No thread library but an API to the kernel thread
facility.
 Switching between threads requires the kernel.
 Scheduling is done on a thread basis.
Kernel can simultaneously schedule multiple threads from the
same process on multiple processes.
If one threads in a process is blocked, the Kernel can schedule
another threads of the same process.
Kernel routines themselves can multithreaded.
Kernel threads are generally slower to create and manage than
the user threads.
Transfer of control from one thread to another within same
process requires a mode switch to the Kernel.
User Level VS Kernel Level Thread
User Level Threads Kernel Level Thread
Faster to create and manage. Slower to create and manage.
Implementation is by a thread
library at the user level.
OS supports creation of
kernel thread.
Generic and can run on any OS. Specific to the OS.
Multi-threaded application can
not take advantage of
multiprocessing.
Kernel routines themselves
can be multithreaded.
1. Many to One Relationship
 Many user-level threads mapped to single kernel
threads.
2. Many to Many Relationship
 Allows many user level threads to be mapped to many
kernel threads.
 Allows the operating system to create a sufficient
number of kernel threads.
2. One to One Relationship
 Each user-level thread maps to kernel threads.
 Allow another threads to run if block.
 Run parallel
 Each CPU has equal access to resources.
 Each CPU determines what to run using a standard
algorithm.
 Kernel can execute on any processor.
- Allowing portions of the kernel to execute in
parallel.
 Typically each processor does self-scheduling from
the pool of available process or threads.
Proc 1 Proc 2 Proc 3 Proc 4
Mem 1 Mem 2 Mem 3 Mem 4
Symmetric Multiprocessor Organization
1. Simultaneous concurrent processes or threads
2. Scheduling
3. Synchronization
4. Memory management
5. Reliability and fault tolerance
 From multiple boards on a shared bus to multiple
processors inside a single chip.
 Caches both
1. Private data are used by a single processor
2. Shared data are used by multiple processors
 Caching shared data
reduces latency to shared data, memory
bandwidth for shared data, and interconnect
bandwidth
cache coherence problem
ADVANTAGES
High reliability
Fault tolerant support is straight forward
Balanced workload
DISADVANTAGES
Resources conflicts.
Example: memory and I/O
Complex implementation
 Involves synchronization of access to global ready
queue
Eg: only one processor must execute a job at
one time
 Processors: CPU1, CPU2, CPU3, …
 When a processor accesses the ready queue:
1. If they attempt access to the ready queue, all
other processors (CPU2, CPU3, …) must wait;
denied access.
2. Accessing processor (eg. CPU1) removes a process
from ready queue, and dispatch’s process on itself.
3. Just before dispatch, that processor makes ready
queue again available for use by the other CPU’s.
Synchronization Issues
 This structures the operating system by removing all
nonessential portions of the kernel and implementing
them as system and user and user level programs.
 Provide minimal process and memory management &
communication facility
 Communication between components if the OS is
provided by massage passing
ADVANTAGES
Extending the OS becomes much easier.
Any changes to the kernel tend to be fewer, since
the kernel is smaller.
Provides more security and reability
MAIN DISADVANTAGES
It is poor performance due to increase system
overhead from message passing.
Operating systems developed in the mid to late 1950s were designed with
little concern about structure.
 The problems caused by mutual dependence and interaction were
grossly underestimated.
 In these monolithic operating systems, virtually any procedure can
call any other procedure – the approach
Modular programming techniques were needed to handle this scale of
software development.
 Layered operating systems were developed in which functions are
organized hierarchically and interaction only takes place between
adjacent layers.
 Most or all of the layers execute in kernel mode.
PROBLEM:
Major changes in one layer can have numerous effects on code in
adjacent layers - many difficult to trace.
And security is difficult to build in because of the many interactions
between adjacent layers.
In a Microkernel - only absolutely essential core OS functions should be in
the kernel.
 Less essential services and applications are built on the
microkernel and execute in user mode.
 Common characteristic is that many services that traditionally
have been part of the OS are now external subsystems that
interact with the kernel and with each other;
 These include device drivers, file systems, virtual memory
manager, windowing system, and security services.
The microkernel functions as a message exchange:
 It validates messages,
 Passes them between components,
 Grants access to hardware.
The microkernel also performs a protection function;
it prevents message passing unless exchange is allowed.
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System

More Related Content

What's hot

Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
Sonali Chauhan
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
Nitish Gulati
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture
Haris456
 

What's hot (20)

Operating System-Threads-Galvin
Operating System-Threads-GalvinOperating System-Threads-Galvin
Operating System-Threads-Galvin
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Thread management
Thread management Thread management
Thread management
 
Multithreading
MultithreadingMultithreading
Multithreading
 
3 process management
3 process management3 process management
3 process management
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Ch4 Threads
Ch4 ThreadsCh4 Threads
Ch4 Threads
 
Lecture 5 process concept
Lecture 5   process conceptLecture 5   process concept
Lecture 5 process concept
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
 
OS Process and Thread Concepts
OS Process and Thread ConceptsOS Process and Thread Concepts
OS Process and Thread Concepts
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Multithreading
Multithreading Multithreading
Multithreading
 
Networking threads
Networking threadsNetworking threads
Networking threads
 
Multithreading computer architecture
 Multithreading computer architecture  Multithreading computer architecture
Multithreading computer architecture
 
Pthread
PthreadPthread
Pthread
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPT
 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
 

Viewers also liked

Design Verification to Application Validation of a Multiprocessor SoC
Design Verification to Application Validation of a Multiprocessor SoCDesign Verification to Application Validation of a Multiprocessor SoC
Design Verification to Application Validation of a Multiprocessor SoC
DVClub
 
20G blogs Eminent Presentation 2010 Copenhagen
20G blogs Eminent Presentation 2010 Copenhagen20G blogs Eminent Presentation 2010 Copenhagen
20G blogs Eminent Presentation 2010 Copenhagen
Donal O' Mahony
 

Viewers also liked (15)

Design Verification to Application Validation of a Multiprocessor SoC
Design Verification to Application Validation of a Multiprocessor SoCDesign Verification to Application Validation of a Multiprocessor SoC
Design Verification to Application Validation of a Multiprocessor SoC
 
20G blogs Eminent Presentation 2010 Copenhagen
20G blogs Eminent Presentation 2010 Copenhagen20G blogs Eminent Presentation 2010 Copenhagen
20G blogs Eminent Presentation 2010 Copenhagen
 
Vaikundarajan Expresses Remorse on Phillip Hughes Death
Vaikundarajan Expresses Remorse on Phillip Hughes DeathVaikundarajan Expresses Remorse on Phillip Hughes Death
Vaikundarajan Expresses Remorse on Phillip Hughes Death
 
Cog5 lecppt chapter01
Cog5 lecppt chapter01Cog5 lecppt chapter01
Cog5 lecppt chapter01
 
Multiprocessor architecture and programming
Multiprocessor architecture and programmingMultiprocessor architecture and programming
Multiprocessor architecture and programming
 
Should I Use Scalding or Scoobi or Scrunch?
Should I Use Scalding or Scoobi or Scrunch? Should I Use Scalding or Scoobi or Scrunch?
Should I Use Scalding or Scoobi or Scrunch?
 
Process creation and termination In Operating System
Process creation and termination In Operating SystemProcess creation and termination In Operating System
Process creation and termination In Operating System
 
OS Chapter03
OS Chapter03OS Chapter03
OS Chapter03
 
BITS 1213 - OPERATING SYSTEM (PROCESS,THREAD,SYMMETRIC MULTIPROCESSOR,MICROKE...
BITS 1213 - OPERATING SYSTEM (PROCESS,THREAD,SYMMETRIC MULTIPROCESSOR,MICROKE...BITS 1213 - OPERATING SYSTEM (PROCESS,THREAD,SYMMETRIC MULTIPROCESSOR,MICROKE...
BITS 1213 - OPERATING SYSTEM (PROCESS,THREAD,SYMMETRIC MULTIPROCESSOR,MICROKE...
 
Apportioning Monoliths
Apportioning MonolithsApportioning Monoliths
Apportioning Monoliths
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
An Introduction to Python Concurrency
An Introduction to Python ConcurrencyAn Introduction to Python Concurrency
An Introduction to Python Concurrency
 
clinic database and software management system
clinic database and software management systemclinic database and software management system
clinic database and software management system
 
TEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkTEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of Work
 

Similar to Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System

Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
chnrketan
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
bleh23
 
operating system for computer engineering ch3.ppt
operating system for computer engineering ch3.pptoperating system for computer engineering ch3.ppt
operating system for computer engineering ch3.ppt
gezaegebre1
 

Similar to Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System (20)

Unit 2 part 2(Process)
Unit 2 part 2(Process)Unit 2 part 2(Process)
Unit 2 part 2(Process)
 
Chapter 3 chapter reading task
Chapter 3 chapter reading taskChapter 3 chapter reading task
Chapter 3 chapter reading task
 
Os
OsOs
Os
 
Process & Thread Management
Process & Thread  ManagementProcess & Thread  Management
Process & Thread Management
 
Operating System
Operating SystemOperating System
Operating System
 
4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
 
Process Management
Process ManagementProcess Management
Process Management
 
Operating system.pptx
Operating system.pptxOperating system.pptx
Operating system.pptx
 
Process Management Operating Systems .pptx
Process Management        Operating Systems .pptxProcess Management        Operating Systems .pptx
Process Management Operating Systems .pptx
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
Thread
ThreadThread
Thread
 
OS_module2. .pptx
OS_module2.                          .pptxOS_module2.                          .pptx
OS_module2. .pptx
 
Wiki 2
Wiki 2Wiki 2
Wiki 2
 
Lecutur24 25
Lecutur24 25Lecutur24 25
Lecutur24 25
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
 
process and thread.pptx
process and thread.pptxprocess and thread.pptx
process and thread.pptx
 
operating system for computer engineering ch3.ppt
operating system for computer engineering ch3.pptoperating system for computer engineering ch3.ppt
operating system for computer engineering ch3.ppt
 
lec2.pptx
lec2.pptxlec2.pptx
lec2.pptx
 
Completeosnotes
CompleteosnotesCompleteosnotes
Completeosnotes
 
Threads
ThreadsThreads
Threads
 

Recently uploaded

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System

  • 1. Student’s Name Matric Number Aniyah binti Amirhussin B031310042 Azwana binti Ahmad B031310071 Daliah binti Daud B031310491 Goh Yu Fern B031310113 Nik Siti Noor Fadhillah binti Md Saad B031310496 Rahilda Nadhirah Norizzaty binti Rahiddin B031310111
  • 2.
  • 3.  Also known as task.  Execution of an individual program.  Contains program code and its current activity  Can be traced to list the sequence of instructions that execute. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.
  • 4.  While program is executing, processes are stored in data structure known as PCB.  PCB is created for each process.  The creation and management of PCB is done by OS  PCB has sufficient information. Thus, it’s possible to interrupt a running process and later resume execution as if there is no interruption. Process = Program code + Associated data + PCB
  • 5. Change to other value, For example: blocked or ready Current values are saved in appropriate fields of corresponding PCB OS is now free to put other process in Running state
  • 6.  OS program that moves the processor from one process to another.  Prevents a single process from monopolizing processor time.  Decides who goes next according to a scheduling algorithm.  CPU will execute instructions from the dispatcher while switching from process A to process B.
  • 7. Process Creation * Process (parent) creates another process (child) called as process spawning. * Submission of batch job and user is logs on. * It is created to provide service such as printing. Process Termination * Batch job issues Halt instruction (OS service call for termination) and user is logs off. * Occurs when quitting an application or error and faults condition appear. Reasons for Process Termination * Normal completion * Time limit exceeded * Memory unavailable * Protection error (eg: write to read-only file) * I/O failure
  • 8. o Process may be in one of two states: running, not running. o Dispatcher cannot select the process that is in the queue the longest because it may be blocked o Solution: split Not Running into two states: i) Ready – prepare to execute when given opportunity ii) Blocked/Waiting – process cannot execute until some event occurs
  • 9. 3. A Five-State Process Model
  • 10. 4. Suspended Process  Processor faster than I/O (processes wait for I/O)  Swap these processes to disk to free up memory  Block state -> suspend state, when swap to disk  Two new state - Blocked, suspend: blocked processes which have been swapped out to disk - Ready, suspend: ready processes which have been swapped out to disk
  • 13. OS have tables for managing processes and resources. 1. Memory tables - Allocation of main and secondary memory to processes - Protection attributes for access to shared memory regions - Information needed to manage virtual memory 2. I/O tables - I/O device is available or assigned - Status of I/O operation - Location in main memory being used as the source or destination of the I/O transfer
  • 14. 3. File tables - Existence of files - Location on secondary memory - Current Status - Attributes - Sometimes this information is maintained by a file- management system 4. Process tables - Where process is located - Attributes necessary for its management - Process ID - Process state - Location in memory
  • 15. 1. Modes of Execution i. User Mode * Less-privileged mode * User programs typically execute in this mode ii. System mode, Control mode or Kernel Mode * More-privileged mode * Kernel of the OS
  • 16. 2. Process Creation  Assign a unique process identifier  Allocate space for the process  Initialize process control block  Set up appropriate linkages Eg: add new process to linked list used for scheduling queue  Create or expand other data structures Eg: maintain an accounting file
  • 17.  A thread is the smallest unit of processing that can be performed in an OS.  An execution state (running, ready, etc.)  Has an execution stack.  In most modern operating systems, a thread exists within a process - that is, a single process may contain multiple threads.
  • 18.  On a single processor, multi threading generally occurs by as in multitasking, the processor switches between different threads.  This context switching generally happens frequently enough that the user perceives the threads or tasks to be running at the same time.  On the multiprocessor or mutli-core system, the threads or task actually do run at the same time, with each processor or core running a particular thread or task.
  • 20. • Multithreading: when OS supports multiple threads of execution within a single process. • Single threading: when the OS does not recognize the concept of thread. • MS-DOS supports a single thread. • UNIX supports multiple user processes but only supports one thread per process • Windows 2000, Solaris, Linux, Mach, and OS/2 support multiple threads
  • 21. Thread Control Block contains a register image, thread priority and thread state information
  • 22.  Thread minimize context switching time.  Use of threads provides concurrency within a process.  Efficient communication.  Economy- It is more economical to create and context switch threads.  Utilization of multiprocessor architectures to a greater scale and efficiency.
  • 23.  Three key states: running, ready, blocked  No suspend state since all threads share the same address space.  Suspending a process involves suspending all threads of the process.  Termination of a process, terminates all threads within the process.  States associated with a change in thread state: i. Spawn -spawn another thread ii. Block iii. Unblock iv. Finish
  • 25. 1. User Level Threads – (user managed thread) Diagram Of User-level Thread o All thread management is done by the application. o The kernel is not aware of the existence of threads. o OS only schedules the process, not the threads within process. o Programmer using a thread library to manage threads (create,delete,schedule)
  • 26. User-level threads can be implemented on operating system that does not support threads. Implementing user-level threads does not require modification of operating system where everything is managed by the thread library. Simple representation which the thread is represented by a the thread ID, program counter, register, stack , all stored in user process address space. Simple management where creating new threads, switching threads and synchronization between threads can be done without intervention of the kernel. Fast and efficient where switching thread is much more inexpensive compared to a system call. There is a lack of coordination between threads and operating system kernel. A process gets one time slice no matter it has 1 thread or 10000 threads within it. It is up to the thread itself to give up the control to other threads. If one thread made a blocking system call, the entire process can be blocked in the kernel, even if other threads in the same process are in the ready state.
  • 27. 2. Kernel-Level Threads (OS managed threads acting on kernel, an OS core)  All thread management is done by the kernel.  Kernel maintains context information for the process and the threads.  No thread library but an API to the kernel thread facility.  Switching between threads requires the kernel.  Scheduling is done on a thread basis.
  • 28. Kernel can simultaneously schedule multiple threads from the same process on multiple processes. If one threads in a process is blocked, the Kernel can schedule another threads of the same process. Kernel routines themselves can multithreaded. Kernel threads are generally slower to create and manage than the user threads. Transfer of control from one thread to another within same process requires a mode switch to the Kernel.
  • 29. User Level VS Kernel Level Thread User Level Threads Kernel Level Thread Faster to create and manage. Slower to create and manage. Implementation is by a thread library at the user level. OS supports creation of kernel thread. Generic and can run on any OS. Specific to the OS. Multi-threaded application can not take advantage of multiprocessing. Kernel routines themselves can be multithreaded.
  • 30. 1. Many to One Relationship  Many user-level threads mapped to single kernel threads.
  • 31. 2. Many to Many Relationship  Allows many user level threads to be mapped to many kernel threads.  Allows the operating system to create a sufficient number of kernel threads.
  • 32. 2. One to One Relationship  Each user-level thread maps to kernel threads.  Allow another threads to run if block.  Run parallel
  • 33.  Each CPU has equal access to resources.  Each CPU determines what to run using a standard algorithm.  Kernel can execute on any processor. - Allowing portions of the kernel to execute in parallel.  Typically each processor does self-scheduling from the pool of available process or threads. Proc 1 Proc 2 Proc 3 Proc 4 Mem 1 Mem 2 Mem 3 Mem 4
  • 35. 1. Simultaneous concurrent processes or threads 2. Scheduling 3. Synchronization 4. Memory management 5. Reliability and fault tolerance
  • 36.  From multiple boards on a shared bus to multiple processors inside a single chip.  Caches both 1. Private data are used by a single processor 2. Shared data are used by multiple processors  Caching shared data reduces latency to shared data, memory bandwidth for shared data, and interconnect bandwidth cache coherence problem
  • 37. ADVANTAGES High reliability Fault tolerant support is straight forward Balanced workload DISADVANTAGES Resources conflicts. Example: memory and I/O Complex implementation
  • 38.  Involves synchronization of access to global ready queue Eg: only one processor must execute a job at one time  Processors: CPU1, CPU2, CPU3, …  When a processor accesses the ready queue: 1. If they attempt access to the ready queue, all other processors (CPU2, CPU3, …) must wait; denied access. 2. Accessing processor (eg. CPU1) removes a process from ready queue, and dispatch’s process on itself. 3. Just before dispatch, that processor makes ready queue again available for use by the other CPU’s. Synchronization Issues
  • 39.  This structures the operating system by removing all nonessential portions of the kernel and implementing them as system and user and user level programs.  Provide minimal process and memory management & communication facility  Communication between components if the OS is provided by massage passing
  • 40. ADVANTAGES Extending the OS becomes much easier. Any changes to the kernel tend to be fewer, since the kernel is smaller. Provides more security and reability MAIN DISADVANTAGES It is poor performance due to increase system overhead from message passing.
  • 41.
  • 42. Operating systems developed in the mid to late 1950s were designed with little concern about structure.  The problems caused by mutual dependence and interaction were grossly underestimated.  In these monolithic operating systems, virtually any procedure can call any other procedure – the approach Modular programming techniques were needed to handle this scale of software development.  Layered operating systems were developed in which functions are organized hierarchically and interaction only takes place between adjacent layers.  Most or all of the layers execute in kernel mode. PROBLEM: Major changes in one layer can have numerous effects on code in adjacent layers - many difficult to trace. And security is difficult to build in because of the many interactions between adjacent layers.
  • 43. In a Microkernel - only absolutely essential core OS functions should be in the kernel.  Less essential services and applications are built on the microkernel and execute in user mode.  Common characteristic is that many services that traditionally have been part of the OS are now external subsystems that interact with the kernel and with each other;  These include device drivers, file systems, virtual memory manager, windowing system, and security services. The microkernel functions as a message exchange:  It validates messages,  Passes them between components,  Grants access to hardware. The microkernel also performs a protection function; it prevents message passing unless exchange is allowed.