Lecture 9B Flashcards

1
Q

Describe Consumer-Producer scenario:

A

A thread called Producer provides data in a queue (called a buffer). Another thread (consumer) removed this data from the queue. On both sides the queue(buffer) is a gated resource.

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

What does wait() do?

A

It suspends execution of the thread until it receives notification from some other thread. Signaling is done using notify() or notifyAll() in the other thread (producer).

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

What are condition variables?

A

They allow a thread to block (suspend execution) until notified by another thread that a condition is fulfilled.

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