wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

A critical section is a program segment

A
Which should run in a certain specified amount of time
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
which avoids dead lock
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
where shared resources are accessed
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
which must be enclosed by a pair of semaphore operations P and V
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B where shared resources are accessed

A critical section is a program segment where shared resources are accessed.

In concurrent programming, concurrent accesses to shared resources can lead to unexpected or erroneous behaviour, so parts of the program where the shared resource is accessed are protected. This protected section is the critical section . It cannot be executed by more than one process at a time.

A critical section is the part of a program that accesses shared resources. Only when a process is in its critical section can it be in a position to disrupt other processes. We can avoid race conditions by making sure that no two processes enter their critical sections at the same time.

Critical section is a piece of code that accesses a shared resource that must not be concurrently accessed by more than one thread of execution.


flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Informal workers
CIVICS
Watch in App
Join BYJU'S Learning Program
CrossIcon