Chapter 25 Flashcards
What is critical region
A critical region is a section of code that is always executed under mutual exclusion.
What are 2 parts of critical region
- Variables that must be accessed under mutual exclusion
2. A new language statement that identifies a critical region in which the variables are accessed
What are monitors
High-level synchronization construct that allows the safe sharing of an abstract data type among concurrent cooperating processes.
How many process can be active within a monitor
Only 1
What is abstract data type
There is a data and then some defined functions that access that data.
Monitor resembles to class. What is the difference between monitor and class
In class we can access as many functions as we like but in monitor only one function can be accessed by a process.
How to define monitor
monitor monitor-name { }
What about monitor with condition variables
Additional synchronization constructs are needed to model some synchronization problems. They can be modeled with condition variables.
How to define condition variables
condition x, y;
How many operations can be performed on condition variables and which are they
2 operations. wait and signal
What is null operation
If there is no process waiting on condition variable and some process invoke signal operation on that condition variable then it is called null operation. It means nothing is happened.