The document discusses race conditions that occur when multiple processes access shared data concurrently. A critical section is a block of code that only one process can execute at a time to avoid race conditions. The critical section problem aims to ensure only one process is in its critical section at once using mutual exclusion. Mutual exclusion methods like semaphores are used to prevent simultaneous access to shared resources like global variables.
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
#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.