1
 When two or more processes are
reading or writing some shared data
and the final result depends on who
runs precisely when, is called race
condition.
 Race condition occurs when two or
more operations occur in an
undefined manner.
 Race condition should be avoided
because they can cause fine errors in
applications and are difficult to
debug.
2
 A critical section is a block of code
that only one process at a time can
execute.
 The critical section problem is to
ensure that only one process at a
time is allowed to be operating in its
critical section.
 Each process takes permission from
operating system to enter into the
critical section:
a) Entry Section
b) Remainder Section
c) Exit Section
3
 Solution of critical section must satisfy :
a) Mutual Exclusion : If a process is executing in its
critical section, then no other process is allowed
to execute in the critical section.
b) Progress : If no process is in the critical section,
then no other process from outside can block it
from entering the critical section.
c) Bounded Waiting : A bound must exist on the
number of times that other processes are
allowed to enter their critical sections after a
process has made a request to enter its critical
section and before that request is granted.
 OS handles critical section problem by
using Kernel, which is classified as :
a) Preemptive Kernel
b) Non-preemptive Kernel
4
 Mutual exclusion methods are used in
concurrent programming to avoid the
simultaneous use of a common
resource, such as a global variable, by
pieces of computer code called critical
section.
 Mutual exclusion can be carried out by:
a) Software Method (Highly error prone)
b) Hardware Method (Faster but incomplete)
c) Programming Language Method
5
1) At any time, only one process is allowed to enter in its critical
section.
2) Solution is implemented purely in software.
3) A process remains inside the critical section for a bounded time
only.
4) A process can not prevent other process from entering into critical
section.
5) A process must not be indefinitely postponed from entering its
critical section.
6
7

Critical Section in Operating System

  • 1.
  • 2.
     When twoor more processes are reading or writing some shared data and the final result depends on who runs precisely when, is called race condition.  Race condition occurs when two or more operations occur in an undefined manner.  Race condition should be avoided because they can cause fine errors in applications and are difficult to debug. 2
  • 3.
     A criticalsection is a block of code that only one process at a time can execute.  The critical section problem is to ensure that only one process at a time is allowed to be operating in its critical section.  Each process takes permission from operating system to enter into the critical section: a) Entry Section b) Remainder Section c) Exit Section 3
  • 4.
     Solution ofcritical section must satisfy : a) Mutual Exclusion : If a process is executing in its critical section, then no other process is allowed to execute in the critical section. b) Progress : If no process is in the critical section, then no other process from outside can block it from entering the critical section. c) Bounded Waiting : A bound must exist on the number of times that other processes are allowed to enter their critical sections after a process has made a request to enter its critical section and before that request is granted.  OS handles critical section problem by using Kernel, which is classified as : a) Preemptive Kernel b) Non-preemptive Kernel 4
  • 5.
     Mutual exclusionmethods are used in concurrent programming to avoid the simultaneous use of a common resource, such as a global variable, by pieces of computer code called critical section.  Mutual exclusion can be carried out by: a) Software Method (Highly error prone) b) Hardware Method (Faster but incomplete) c) Programming Language Method 5
  • 6.
    1) At anytime, only one process is allowed to enter in its critical section. 2) Solution is implemented purely in software. 3) A process remains inside the critical section for a bounded time only. 4) A process can not prevent other process from entering into critical section. 5) A process must not be indefinitely postponed from entering its critical section. 6
  • 7.

Editor's Notes

  • #2 To use this title animation slide with a new image simply 1) move the top semi-transparent shape to the side, 2) delete placeholder image, 3) click on the picture icon to add a new picture, 4) Move semi-transparent shape back to original position, 5) Update text on slide.
  • #8 To use this title animation slide with a new image simply 1) move the top semi-transparent shape to the side, 2) delete placeholder image, 3) click on the picture icon to add a new picture, 4) Move semi-transparent shape back to original position, 5) Update text on slide.