Lecture 14: Synchronization 6 Flashcards

1
Q

Monitors:

A

A high-level synchronization abstraction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When thread t calls wait()

A

t releases object lock
t’s state = BLOCKED
t placed in wait set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When thread t calls notify()

A

a. selects some thread t’ from wait list
b. moves t to entry set
c. state of t:= RUNNABLE (Can again compete for lock)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

notify()

A

Selects arbitrary thread from wait set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

notifyAll ():

A

Removes ALL threads from wait set and puts them in entry set
Best to use if potentially multiple threads in wait set
(Safe if thread code loops checking conditions)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly