In: Computer Science
Are there any limitations on the number of CPU instructions inside a critical section? Why (or why not)?
-There are no limitations on the number of CPU instructions
inside a critical section, apart, it satisfies the critical section
conditions:
A critical section is basically a segment of code that can be
accessed by one process at a time.
do
{
entry;
critical section;
exit section;
Remainder Section
}
while (True);
In Entry Section, process requests for entry in the critical section. Once a process enters into the critical section, it has to go through/satisfies the three steps:
Mutual Exclusion: In mutual exclusion, no process can enter into the critical section, if one process has already entered.
Progress: If no process is executing in the critical section, and other processes are waiting outside the critical section, then processes tahr in the remainder section can participate and decide which process will enter into the critical section next.
Bounded Waiting: In this step, bound prohibits the number of processes to enter into the critical section, after a process has requested to enter into the critical section and before it is granted.