Lecture 8 - Concurrency and Synchronisation 2 Flashcards

1
Q

What is a bounded buffer often a source of synchronisation problems?

A

Multiple producers and consumers trying to access at the same time

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

What is a monitor?

A

Programming language construct that supports controlled access to shared data

A class in which every method automatically acquires lock on entry and releases on exit

combines shared data structures, procedures that operate on them and synchronisation of the concurrent threads that invoke those procedures

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

What is a condition variable?

What are the operations on condition variables?

A

A variable that the Monitor contains and checks to determine when running whether it should remain locked

wait(c) - release monitor lock, wait for somebody else to signal condition

signal(c) - wake up at most one waiting thread

broadcast(c) - wake up all waiting threads

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

What is synchronization?

A

Moderating access to shared objects to ensure at most one thing is modifying it, and giving the ability to wait until some condition is true

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