What issue can arise from the concurrent or parallel execution of processes that share data?
It can contribute to issues involving the integrity of the shared data.
In the bounded-buffer problem, what integer variable can be added to track the number of items in the buffer?
An integer variable, count, initialized to 0.
In the shared circular buffer implementation, what does the in pointer indicate?
The in pointer indicates the next free position in the buffer.
In the shared circular buffer implementation, what does the out pointer indicate?
The out pointer indicates the position of the earliest item in the buffer.
What condition signifies that the shared bounded buffer is empty?
The buffer is empty when count == 0.
What condition signifies that the shared bounded buffer is full?
The buffer is full when count == BUFFER_SIZE.
In the producer process code, what is the purpose of the statement while (count == BUFFER_SIZE);?
It forces the producer to wait, doing nothing, until there is free space in the buffer.
After placing a new item in the buffer, what two variables does the producer process update?
The producer updates the in pointer and increments the count variable.
In the consumer process code, what is the purpose of the statement while (count == 0);?
It forces the consumer to wait, doing nothing, until an item is available in the buffer.
After consuming an item from the buffer, what two variables does the consumer process update?
The consumer updates the out pointer and decrements the count variable.
If count is 5, and a producer executes count++ concurrently with a consumer executing count--, what are the three possible resulting values for count?
The value of count may be 4, 5, or 6.
Following the concurrent execution of count++ and count-- when count was initially 5, what is the only correct final value for count?
The only correct result is count == 5.
The high-level instruction count++ could be implemented in machine language as a sequence of what three operations?
count into a register. 2. Increment the register. 3. Store the register’s value back into count.A situation where multiple processes manipulate the same data concurrently and the outcome depends on the order of access is called a _____.
race condition
How can the race condition on the count variable be prevented?
By ensuring that only one process can manipulate the variable count at a time through synchronization.
What is the term for the segment of code in a process that accesses and updates data shared with other processes?
A critical section.
What is the key feature of a system regarding critical sections?
When one process is executing in its critical section, no other process is allowed to execute in its critical section.
What is the goal of the critical-section problem?
To design a protocol that processes can use to synchronize their activity and cooperatively share data.
What is the name of the code section where a process requests permission to enter its critical section?
The entry section.
In the general structure of a process, what section may follow the critical section?
The exit section.
What is the term for the code of a process that is not the entry, critical, or exit section?
The remainder section.
A solution to the critical-section problem must satisfy what three requirements?
Mutual exclusion, progress, and bounded waiting.
Define the ‘Mutual Exclusion’ requirement for a critical-section solution.
If a process is running in its critical section, then no other processes can be running in their critical sections.
Define the ‘Progress’ requirement for a critical-section solution.
If no process is in its critical section and some wish to enter, the selection of the next process cannot be postponed indefinitely.