A bounded queue is full and the producer keeps sending. What happens next?
- The producer faces back pressure: it waits, or messages are dropped or refused
- Messages speed up to make room
- The consumer quietly deletes old messages
In a message-passing design, who may touch a piece of state?
- Any thread holding the right lock
- Only its single owner
- The thread that arrives first
In the message-passing counter, two senders can still race on the counter value.
Circle one: True False
Your producer outruns your consumer and the queue drops new messages. What is the right response?
- Send even faster to clear the backlog
- Share the counter between threads instead
- Slow the producer, speed the consumer, or size the queue on purpose
An owner starts at 0 and handles add 1, add 1, add 2 in order. What is the final count?
Which comparison of the two designs is fair?
- Shared memory risks races and deadlocks, while message passing risks full queues and ordering surprises
- Message passing removes every possible failure
- Both designs fail in exactly the same ways
Events from two producers must be handled in exact order, but they share one queue. What should you conclude?
- One shared queue guarantees global order by itself
- Message passing removes all ordering questions
- Ordering across producers needs extra design, like stamps or a single sequencer
To gain speed, a teammate lets senders write the counter directly while keeping the queue. What breaks?
- Nothing breaks; this is the recommended design
- The race returns, because the state is shared again
- Messages arrive in perfect order from then on