CIS 451 Week 11

Synchronization

try:   mov x3 <-- x4
       lr  x2 <-- addr
       sc  x3, addr1  # stores value of x3 *and* x3 gets 0 for success, 1 for failure
       bnez x3, try   # loop if fails
       mov x4 <-- x2
        li x2 <-- #1
lockit: EXCH x2, 0(addr_of_lock)
        bnez x2, lockit
lockit: ld x2 <-- 0(lock_addr)
        bnez x2, lockit
        li x2 <-- #1
lockit: EXCH x2, 0(addr_of_lock)
        bnez x2, lockit

Consistency

P1:     A = 0;          P2:     B = 0;
        ......                  .....
        A = 1;                  B = 1;
L1:     if (B == 0) ... L2:     if (A == 0)

Cross-cutting issues (Section 5.7)

RAID

Warehouse scale Computing

Efficiency and Cost (Section 6.4)

Section 6.5

Section 6.7 — Example Google Warehouse