Interview Question · Concept
Exclusive Accesses and the Monitor
The Question
The interviewer asks
Explain how an AXI exclusive read and exclusive write implement a lock, and what EXOKAY and OKAY mean on each.
You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The manager does an exclusive read. A subordinate that supports exclusives records the address and ID in a monitor (a small tracker) and answers EXOKAY. Later the manager does an exclusive write with the same ID, address and attributes. If no one wrote the location meanwhile, the write happens and gets EXOKAY. Otherwise the write is dropped and gets OKAY, and software retries. The bus is never locked in between.
The slots are the monitors for A and B; a successful exclusive write clears both.
- Cycle 0
B's exclusive write address arrives (AWID 2). Both monitors watch 0x600.
- Cycle 1
B's data lands. The monitor for ID 2 matches: the word is written and every monitor on 0x600 is cleared.
- Cycle 4
B is answered: BRESP 1, EXOKAY.
- Cycle 5
A's exclusive write address arrives (AWID 1). No monitor for ID 1 is left.
- Cycle 6
A's data arrives and is dropped.
- Cycle 9
A is answered: BRESP 0, OKAY. For an exclusive write that is failure.
A monitor that still holds gives EXOKAY and a write; an empty one gives OKAY and nothing.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer describes the sequence: exclusive read, monitor, exclusive write. It says OKAY on the exclusive write means it failed.
What Interviewers Listen For (Senior)
A good senior answer knows OKAY on the exclusive read means exclusives are not supported. It lists the size and alignment limits. It knows a monitor may watch up to 128 bytes, which causes false failures.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
What IfProve ItBreak ItCompare
- Exclusive Accesses and the Monitor
-
What IfExclusives to a Subordinate That Lacks ThemL2 Mid-Level
A manager runs an exclusive sequence against a subordinate with no exclusive monitor. What happens on each step?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The exclusive read returns OKAY instead of EXOKAY: the data is valid, but nothing is monitored. If the manager writes anyway, the exclusive write also gets OKAY. The location is updated as a normal write, so a lock "fails" yet changes memory. The spec recommends treating OKAY on the read as "not supported" and skipping the write.
Self-Check
Tick each key point you covered in your answer.
Missed Corner
"The write gets OKAY, so it failed and memory is unchanged."
Only a subordinate with a monitor drops a failed exclusive write. One without support writes the location and still answers OKAY.
Source AMBA AXI Protocol Specification IHI 0022L §A6.3.4 Exclusive access from the perspective of the Subordinate
-
Break ItA Spinlock That Trusts OKAYL2 Mid-LevelL3 Senior
Break it: a spinlock routine treats any non-error response to its exclusive write as success. What can happen?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
On a memory without an exclusive monitor, both steps return OKAY, so two cores can both believe they hold the lock. On a memory with a monitor, OKAY on the exclusive write means it failed and nothing was written. Either way, only EXOKAY means success. The routine must retry on OKAY, or report that exclusives are not supported.
Self-Check
Tick each key point you covered in your answer.
Spec Misquote
"OKAY means success, so the lock is taken."
For an exclusive write, OKAY means the exclusive failed or is not supported. Only EXOKAY means the write succeeded.
Source AMBA AXI Protocol Specification IHI 0022L §A6.3.2 Exclusive access from the perspective of the Manager
-
Break ItTesting an Exclusive MonitorL3 Senior
You are verifying a memory controller's exclusive monitor. Which scenarios do you make sure you hit?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Races: two managers on one address must give exactly one EXOKAY, and a normal write in between must fail the sequence. ID handling: reusing the ID on a new address moves the monitor. A size or length mismatch between the read and the write may fail the write. Granule: the monitor may watch a wide block, so a write to a neighbouring byte may legally fail the sequence. Limits: test unaligned, non-power-of-two and over-16-beat exclusives too.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Senior)
A good senior answer lists races, interfering writes, ID reuse, mismatched attributes and the monitor's block size. It knows which results the spec leaves to the design.
-
CompareExclusives Against AXI5 AtomicsL3 Senior
Why did AXI5 add atomic transactions when exclusives already existed?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
An exclusive pair needs two round trips, and it can fail and retry under contention. The data also travels to the manager and back. An atomic transaction sends the operation to the data instead. The subordinate or a near-memory agent does the read-modify-write in one transaction, so the location is unavailable for less time. The cost is ALU logic at the target and a more complex protocol.
Self-Check
Tick each key point you covered in your answer.
-
Prove ItSolve P2.13.1: An Exclusive MonitorSimulator-graded
Show it, don't just say it: this Silicon Lab problem is graded by the simulator.
What People Get Wrong
Common wrong answers and why they fail.
Misconception
"OKAY on the exclusive write is fine; OKAY is success."
For an exclusive write OKAY means it failed and memory was not updated. Only EXOKAY is success.
Source AMBA AXI Protocol Specification IHI 0022L §A3.3.1 Write response, Table A3.28; §A6.3.2
Misconception
"Exclusive access locks the bus until the write."
That was AXI3 locked access. Exclusives keep the bus open, and the monitor detects interference after the fact.
Source AMBA AXI Protocol Specification IHI 0022L §A6.3 Exclusive accesses