130 likes | 153 Views
Partial Snapshots. Hagit Attiya (CS, Technion) Joint work with Rachid Guerraoui (EPFL) Eric Ruppert (York University). Taking a Full Snapshot. n components Update a single component Scan all the components “at once” (atomically) Provides an instantaneous view of the whole memory.
E N D
Partial Snapshots Hagit Attiya (CS, Technion) Joint work with Rachid Guerraoui (EPFL) Eric Ruppert (York University)
Taking a Full Snapshot n components Update a single component Scan all the components “at once” (atomically) Provides an instantaneous view of the whole memory update scan v1,…,vn ok SPAA
Taking a Partial Snapshot n components Update a single component Scan components “at once” (atomically) Allows to read parts of the memory Worthwhile if we can do it more efficiently than a (full) scan update scan vi1,…,vir ok SPAA
Partial Snapshots: Non-Terminating Algorithm [Afek, Attiya, Dolev, Gafni, Merritt, Shavit, JACM 1993] double collect Update(v,k) A[k] = v,seqi,i • PartialScan() • repeat • read A[i1],…,A[ir] • read A[i1],…,A[ir] • if equal • return A[i1,…,ir] • Linearize: • Updates with their writes • Scans inside the double collects SPAA
Termination? Hat tip [Ellen, Fatuoruo, Ruppert] • Embed a scan within the Update. Update(v,k) V = FullScan A[k] = v,seqi,i,V • PartialScan() • repeat • read A[i1],…,A[ir] • read A[i1],…,A[ir] • if equal • return A[i1,…,ir] • if 2 values in same component • return Vj direct scan • Linearize: • Updates with their writes • Direct scans as before • Borrowed scans in place borrowedscan SPAA
More Efficient Update • Scan only components needed for overlapping scans • But how to know what these are? Active set object: Tracks processes inthe execution [Afek, Stupp, Touitou] join leave getSet ok ok S active set SPAA
p.join ok p.leave ok q.getSet {… …} {…,p,…} More Efficient Update • Scan only components needed for overlapping scans • But how to know what these are? Active set object: Tracks processes inthe execution [Afek, Stupp, Touitou] active set SPAA
Partial Scans w/ Active Set Update(v,k) V = EmbeddedScan() A[k] = v,seqi,i,V • PartialScan() • announce {i1, …, ir} • join • repeat • read A[i1],…,A[ir] • read A[i1],…,A[ir] • ... • leave SPAA
Partial Scans w/ Active Set Update(v,k) V = EmbeddedScan() A[k] = v,seqi,i,V • EmbbededScan() • getSet • read components • repeat • double collect needed components • ... • if 3 different values in same component • borrow the view SPAA
New Active Set Algorithm To join …. last p 16 17 SPAA
New Active Set Algorithm To leave GetSet reads the array ignoring empty locations …. ….,17, last p 16 17 SPAA
Why in the TM Session? • I need to catch a flight at 17h25 • Partial snapshots are very restricted transactions • PartialScan read-only transaction • Update transaction writing to a single location • Understanding them provides a handle on the inherent cost of TM implementations SPAA
Wrap-Up • A new object: partial snapshot • Obvious applications • Implications for TM • Suggested an approach for solving it using an active set object • New active set algorithms? Esp., less space. • Will have applications to adaptive algorithms. • Better algorithms? Lower bounds? SPAA