Write-and-f-array: implementacja i zastosowanie

Abstract

Wprowadzamy nowy obiekt współbieżny: write-and-f-array, podajemy jego implementację wait-free i używamy jej aby skonstruować ulepszoną implementację wait-free obiektu fetch-and-add. Write-and-f-array uogólnia write-and-snapshot dla jednego pisarza w podobny sposób co f-array uogólnia snapshot. Dokładniej, write-and-f-array jest sparametryzowana przez łączny operator ff i koncepcyjnie jest tablicą z dwoma operacjami atomowymi:\\begin{itemize}\\item write-and-f, która modyfikuje jeden element tablicy i zwraca wynik aplikacji ff do wszystkich jej elementów,\\item read, która zwraca wynik aplikacji ff do wszystkich elementów tablicy.\\end{itemize}Podajemy implementację wait-free NN-elementowej write-and-f-array ze złożonością pamięciową O(NlogN)O(N \\log N), złożonością krokową write-and-f O(log3N)O(\\log^3 N) i stałą złożonością operacji read. Implementacja taużywa obiektów CAS o rozmiarze Omega(logM)\\Omega(\\log M), gdzie MM jest całkowitą liczbą wykonanych operacji write-and-f. Pokazujemy też modyfikację tej implementacji, która zmniejsza złożoność krokową write-and-f do O(log2N)O(\\log^2 N), jednocześnie zwiększając złożoność pamięciową do O(Nlog2N)O(N \\log^2 N).Write-and-f-array znajduje zastosowanie w konstrukcji obiektu fetch-and-add dla PP procesorów ze złożonością pamięciową O(PlogP)O(P \\log P) i złożonością krokową operacji O(log3P)O(\\log^3 P). Jest to pierwsza implementacja fetch-and-add z polilogarytmiczną złożonością krokową operacji i podkwadratową złożonością pamięciową, która nie wymaga obiektów CAS lub LL/SC o nierealistycznie dużym rozmiarze.We introduce a new shared memory object: the write-and-f-array, provide its wait-free implementation and use it to construct an improved wait-free implementation of the fetch-and-add object. The write-and-f-array generalizes single-writer write-and-snapshot object in a similar way that the f-array generalizes the multi-writer snapshot object. More specifically, a write-and-f-array is parameterized by an associative operator ff and is conceptually an array with two atomic operations:\begin{itemize}\item write-and-f modifies a single array's element and returns the result of applying ff to all the elements,\item read returns the result of applying ff to all the array's elements.\end{itemize}We provide a wait-free implementation of an NN-element write-and-f-array with O(NlogN)O(N \log N) memory complexity, O(log3N)O(\log^3 N) step complexity of the write-and-f operation and O(1)O(1) step complexity of the read operation. The implementation uses CAS objects and requires their size to be Ω(logM)\Omega(\log M), where MM is the total number of write-and-f operations executed. We also show, how it can be modified to achieve O(log2N)O(\log^2 N) step complexity of write-and-f, while increasing the memory complexity to O(Nlog2N)O(N \log^2 N).The write-and-f-array can be applied to create a fetch-and-add object for PP processes with O(PlogP)O(P \log P) memory complexity and O(log3P)O(\log^3 P) step complexity of the fetch-and-add operation. This is the first implementation of fetch-and-add with polylogarithmic step complexity and subquadratic memory complexity that can be implemented without CAS or LL/SC objects of unrealistic size

    Similar works

    Full text

    thumbnail-image