Concurrency Flashcards
(15 cards)
What is monitor?
A control abstraction one level higher then a semaphore a monitor controls access to recourses upon which threads can be accessed.
What is halting problem?
Is a orbitary computer program in which a computer program determines wether a program will stop or run forever.
The problem is to create a program that will analyse the input size and determine wether the program will halt.
What is the purpose of a sentinel node?
Does not contain data
Points to the first and last items in the list
To provide a way in to the list.
Prefix traversal?
NLR
Infix traversal?
LNR
Postfix?
LRN
What is starvation?
When a process is really aggressive and constantly takes a lock as soon as its released so other processes don’t get to use the recourse.
What is live-lock?
Is when to people are constantly walking in to each not allowing each other to proceed. Imagine this happening in a infinite loop. This is an example of live lock
Race condition?
Is when the counter is not being treated as atomic. The solution is to ensure exclusion of critical solutions.
Deadlock?
Is when two threads are simultaneously waiting for a lock to be released by another thread.
An example of deadlock is dining philosopher.
What is a semaphore?
Controls multiple recourses trying to access a shared recourse.
Semaphore can be added to the dining philosopher to resolve the problem as the waitor will control who sits down.
Wait
??
Notify
??
Notify all?
Bb
Load factor(hash tables)?
The ratio of elements in the table to its size. This is measure of how densely populated this table is. Thus for a table of size m with n elements currently in the table the load factor is n/m.