Join 75,000+ students acing their exams with Studygenie
Unlimited practice
Flashcards, multiple choice and written questions, as many as you want.
Study sets in seconds
Turn your notes and files into a set with AI.
See your progress
Always know what you've learned and what's left.
Questions in this set (15)
Concurrency
is the act of multiple processes (or threads) executing at the same time. When multiple physical CPUs are available, the processes may execute in parallel. On a single CPU, [ ] may be achieved by time-sharing.
critical section
is a segment of code that cannot be entered by a process while another process is executing a corresponding segment of the code.
mutual exclusion
Only one process may be executing within the CS.
what does lockout do
A process not attempting to enter the CS must not prevent other processes from entering the CS.
starvation
A process (or a group of processes) must not be able to repeatedly enter the CS while other processes are waiting to enter.
what is a deadlock
Multiple processes trying to enter the CS at the same time must not block each other indefinitely.
semaphore?
s is a non-negative integer variable that can be accessed using only two special operations, P and V.
what does V(s) do?
increment s by 1
What does P(s) do?
if s > 0, decrement s by 1, otherwise wait until s > 0
test-and-set instruction (TS)
Copies a variable into a register and sets the variable to zero in one indivisible machine cycle.[ ] has the form TS(R, x) where R is a register and x is a memory location and performs the following operations:
what is a lock
is a synchronization barrier through which only one process can pass at a time. TS allows an easy implementation of a [ ]
binary semaphore
can take only the values 0 or 1. Pb and Vb are the simplified P and V operations that manipulate [ ]'s. Pb and Vb on the [ ] sb can be implemented directly using the TS instruction:
Busy-waiting
is the act of repeatedly executing a loop while waiting for some condition to change. [ ] CPU resources and should be avoided whenever possible. The implementation of Pb(sb) using TS is very simple but suffers from the drawback of busy-waiting.
what is monitor
Is a high-level synchronization primitive implemented using P and V operations. Following the principles of abstract data types, a monitor encapsulates data along with functions through which the data may be accessed and manipulated.
condition variable
is a named queue on which processes can wait for some condition to become true.