Advertisement
Guest User

Atomicity

a guest
Dec 13th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. 7.3 Atomicity
  2. A memory access is atomic if it is always performed in its entirerty with no visible fragmentation. Atomic memory accesses are specifically required to implement software semaphores and other shared structures in systems where two different processes on the same processor, or two different processors in a multiprocessor environment, access the same memory location with intent to modify it.
  3. The OpenRISC 1000 architecture provides two dedicated instructions that together perform an atomic read-modify-write operation.
  4. l.lwa rD, I(rA)
  5. l.swa I(rA), rB
  6. Instruction l.lwa loads single word from memory, creating a reservation for a subsequent conditional store operation. A special register, invisible to the programmer, is used to hold the address of the memory location, which is used in the atomic read-modify-write operation.
  7. The reservation for a subsequent l.swa is cancelled if another master reads the same memory location (snoop hit), another l.lwa is executed or if the software explicitly clears the reservation register.
  8. If a reservation is still valid when the corresponding l.swa is executed, l.swa stores general-purpose register rB into the memory. If reservation was cancelled, l.swa is executed as no operation.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement