betaFeedback

WorksComputer Science

Making History-Independence-Preserving LL/SC Writable

Abstract

A randomized implementation of mm LL/SC objects for nn processes, with at most kk outstanding LL() operations each, uses O(kn+m)O(kn + m) CAS and FAID objects [Bencivenga, Habashi, and Woelfel, DISC 2026], achieves constant expected step complexity, and preserves quiescent history independence for algorithms such as [Hagit Attiya, Michael A. Bender, Martín Farach-Colton, Rotem Oshman, and Noa Schiller, STOC 2025]. Unlike some other LL/SC algorithms, such as [Anderson and Moir, WDAG 1995; Jayanti and Petrovic, PODC 2003; Jayanti, Jayanti, and Jayanti, DISC 2023; Hagit Attiya, Michael A. Bender, Martín Farach-Colton, Rotem Oshman, and Noa Schiller, PODC 2024], this algorithm does not support an unconditional write operation. We show how to add a (randomized) wait-free write operation without affecting the asymptotic step or space complexity of the implementation.

2012 ACM Subject Classification Theory of computation → Shared memory algorithms; Theory of computation → Design and analysis of algorithms; Theory of computation → Concurrent algorithms

Keywords and phrases writable LL/SC, concurrent algorithms, history independence, randomized algorithms, wait-freedom

Funding Dante Bencivenga: Natural Sciences and Engineering Research Council of Canada (NSERC) Canada Graduate Scholarship – Doctoral (CGS-D) 578918-2023/198 and University of Calgary Eyes High Doctoral Recruitment Scholarship

Philipp Woelfel: Natural Sciences and Engineering Research Council of Canada (NSERC) reference number RGPIN-2025-04233

Introduction

Asynchronous shared memory algorithms generally require the use of atomic hardware instructions in order to coordinate their actions. Several such instructions are now standard in modern processors, such as swap, compare-and-swap, and fetch-and-add: The swap instruction writes a value into a shared memory word and returns its immediately preceding value. The compare-and-swap, or CAS(old, new), instruction only takes effect if the shared memory word stores an expected old value, in which case it replaces it with new. In this paper, we only need CAS() to return a Boolean indicating success or failure, but it can sometimes return the previous value like a Swap() call. The fetch-and-add instruction adds a given integer value to the value stored in a shared memory word, returning the previous value. In this paper, we need only use fetch-and-add to add or subtract one, which we call fetch-and-increment (FAI()) and fetch-and-decrement (FAD()) respectively.

Although CAS() together with read/write registers is already sufficient to implement any shared object with a sequential specification [21], it can be difficult to use correctly due to the ABA problem. For example, suppose a shared memory object stores value v1v_1, is read by a process, and then the process attempts a CAS() from v1v_1 to v2v_2. The process has no way of knowing whether the object’s value stayed at v1v_1 in between the read and CAS(), or if it changed to v3v_3 and back in between. This ambiguous situation is the ABA problem, and it can easily lead to incorrect changes to data structures if not handled carefully.

The LL/SC object fixes this problem by the use of two operations. The load-linked (LL()) operation reads and returns the object’s value. The store-conditional (SC(v)) operation can succeed or fail: It succeeds and writes a value vv to the object if and only if no Write() or successful SC() took place since the preceding LL(). Otherwise, it fails (see § 2.3 for a more formal specification). Therefore, it prevents the ABA problem, hence avoiding a large class of bugs that are otherwise hard to identify and correct. Most implementations, including ours, also include a verify-link (VL()) operation, which returns a Boolean indicating whether an SC() would succeed, without changing the state of the object.

Unfortunately, LL/SC as defined here does not exist in modern hardware. (Some architectures have a pair of instructions called LL() and SC(), but their SC() operation can spuriously fail even without any change to the memory word, and the pair is strongly restricted in which operations can happen in between. These instructions are sometimes called RLL/RSC to differentiate them from ‘strong’ LL/SC; see, e.g., [26]. As such, several software implementations have been devised [3, 4, 9, 13, 15, 23, 27, 28, 29, 32, 34, 35, 36], with various properties, such as supporting a Write() operation [5, 6, 24, 25, 26], achieving strong linearizability [36], durability [25], or adapting to the number of processes in the system [15, 25, 29]. Although any LL/SC implementation can support a lock-free Write(v) operation by repeatedly calling LL() and then SC(v) until some SC(v) attempt succeeds, supporting wait-free Write() and LL/SC on the same object is more difficult.

Our implementation has optimal space and expected step complexity, uses bounded base objects, supports a Write() operation in addition to LL() and SC(), and preserves quiescent history independence, which we explain next.

History independence is a useful security property which has been heavily studied in the context of sequential computing [1, 11, 12, 14, 17, 18, 19, 20, 33, 37, 38] and recently explored in concurrent computing [6, 7, 9, 39]. Roughly, an implementation is history-independent if the state of memory in between operations is a function only of the abstract state of the implemented object(s). In the context of concurrent computing, there are several ways to define history independence, as explored in [6]. Their most stringent definition is perfect history independence, which requires that shared memory is a function of the abstract state at all points of the execution, but they show that this requires impractically large base objects for most abstract objects.

As with [9], we instead focus on quiescent history independence (QHI). A quiescent state is a system configuration in which no process is pending, i.e., no process has invoked but not yet responded from a method call. An implementation is QHI if its state of shared memory is a function of the abstract state of the concurrent object(s) during all quiescent states reachable in any execution of that implementation. Since algorithms using LL/SC generally do not require outstanding LL() operations (i.e., an LL() operation not yet followed by a matching SC() operation, which we formally define in Definition 2) in quiescent configurations, we use a relaxed definition of QHI, following [9]: We replace quiescent states in the definition of QHI with settled states, which are quiescent states with the additional property that no process has an outstanding LL() operation. The state of shared memory then needs to be a function of the abstract objects’ state during settled states of any reachable execution. An LL/SC implementation satisfying this relaxed definition, such as ours, is QHI-preserving. Any algorithm using a QHI-preserving LL/SC implementation, which does not have outstanding LL() operations while processes are idle, satisfies QHI. This is usually possible to achieve by adding “clear-link” or CL() operations before method responses, which clears outstanding LL() operations.

There are few LL/SC implementations which also provide a Write() operation with sub-O(m⋅n)O(m \cdot n) space complexity, where mm is the number of LL/SC objects and nn is the number of processes. Jayanti, Jayanti, and Jayanti’s implementation [25] has constant step complexity, optimal adaptive space complexity of O(m+n+C)O(m+n+C), where CC is the total number of outstanding LL() operations at a given time, and it is durable on non-volatile memory. However, it uses unbounded sequence numbers, and is therefore not suitable for history independent algorithms. The implementation of Attiya, Bender, Farach-Colton, Oshman, and Schiller [6] satisfies perfect history independence, but uses large base objects of size O(n)O(n) bits and is only lock-free.

Other papers give transformations to add a Write() operation to existing LL/SC implementations: Jayanti [24] gave a transformation to obtain a writable LL/SC object from two non-writable LL/SC objects, attaching constant-size tags to the objects’ values. However, because the algorithm’s correctness requires these tags to not be reset in quiescent states, the transformation does not preserve history independence. Another, more general, transformation by Aghazadeh, Golab, and Woelfel adds unconditional Write() operations to shared objects [2], and Ben-David, Blelloch, Friedman, and Wei later optimized their space complexity [8], but their transformation increases the space by O(n2)O(n^2) additional base objects. Moreover, their transformation also does not preserve history independence, unlike our implementation.

Our implementation is based on that of Bencivenga, Habashi, and Woelfel [9], which has the above features but without a Write() operation. The addition of a randomized wait-free Write() operation and a new correctness analysis are the main technical contributions of this paper. Our Write() operation can also naturally be used as a Swap() operation because it internally linearizes at a hardware Swap() operation (which is not used in [9]).

Other papers give transformations to add a Write() operation to existing LL/SC im- plementations: Jayanti [24] gave a transformation to obtain a writable LL/SC …

Theorem 1. Let nn be the number of processes and kk be the maximum number of simultaneously outstanding LL() operations per process. Then there is a linearizable and QHI-preserving implementation of mm LL/SC objects from mm CAS/Swap objects, storing LL/SC values plus tags of log⁡(kn)+O(1)\log(kn) + O(1) bits, and O(m+kn)O(m + kn) FAID/CAS objects of log⁡n+O(1)\log n + O(1) bits. The implementation supports the implemented methods LL(), SC(), Write(), Swap(), CL(), Read(), and VL(), with O(1)O(1) expected step complexity under the weak adaptive adversary.

Because our implementation uses more base objects, larger tags, and more steps per implemented method than [9], while also using a wider variety of primitive operations, their implementation is preferable when unconditionally writing to LL/SC objects is not required.

Like the implementation of [9], we attach bounded tags to each CAS object that implements an LL/SC word, of size ⌈log⁡(k+1)n⌉+2\lceil\log(k + 1)n\rceil+ 2 bits. As [9, 13] argue, kk is at most 3 in published algorithms using LL/SC, thus making our tags of at most ⌈log⁡n⌉+4\lceil\log n\rceil+ 4 bits in practice. Since 64-bit heap pointers generally have the high 16 bits and low 3 bits set to zero [30], this allows a pointer to be stored with 19 tag bits into one 64-bit word. As a result, our implementation can be used to store pointer values in LL/SC objects if the number of processes is up to 215=32,7682^{15} = 32{,}768, which matches the default maximum number of processes and threads on Linux [31].

The additional complexity needed to support unconditional wait-free Write() arises in part because it becomes more difficult to correctly choose a new tag to prevent ABAs. In particular, [9] counts how many processes have an outstanding LL() operation which have seen each tag value in FAID objects, and SC() randomly probes these usage counts to find a tag with a usage count of zero. This works in part because a successful SC() must be preceded by an LL() operation, and therefore the previous tag has a nonzero usage count, ensuring that a successful SC() always changes the tag. However, an unconditional Write() operation has no such prerequisite, so a further mechanism is needed to ensure that it always changes that tag, so that concurrent SC() operations can fail. As such, our usage counts additionally count how many LL/SC objects are currently using a given tag. SC() and Write() calls attempt a CAS() from zero to one on a randomly probed usage count, and then keep the usage count incremented until the LL/SC object no longer stores that tag. This makes tracking usage counts more complicated, since the responsibility for decrementing them can shift to a different process, and it affects several other aspects of the analysis.

The remainder of the paper is structured as follows: Section 2 defines the shared-memory model and the specification of writable LL/SC, Section 3 presents our implementation and intuitive explanations for it, Section 4 proves Theorem 1, and Section 5 concludes the paper.

Preliminaries

We use the standard asynchronous shared memory model, where nn processes communicate by performing atomic shared-memory operations on shared objects. At each point in time of the execution (which we refer to simply as a ‘point’), exactly one shared memory operation takes place.

Primitive Operations

The atomic primitive operations we use are Read(), CAS(), FAI(), FAD(), and Swap(). The Read() operation returns the value of the shared object. The Swap(val) operation writes valval into the shared object, and returns its previous value. The CAS(old,new) operation writes newnew into the shared object and returns True if and only if its previous value was oldold, and otherwise leaves the object unchanged and returns False. Finally, the FAI() and FAD() increment or decrement the object’s (integer) value, respectively, and returns the previous value. In our analysis, we initially assume that a FAI() on value max\mathit{max} wraps to back to 0, and similarly that a FAD() on 0 wraps it to max\mathit{max}. We prove (Lemma 7 and Lemma 12(a)) that overflow and underflow never occur on the FAID objects, and therefore those objects can have any overflow and underflow behaviour (including having a larger range of possible values before overflowing).

The objects in our implementation require the combinations Read(), CAS(), and Swap() for elements of an array LL, Read(), FAI(), and FAD() for elements of an array CC, and FAI(), FAD(), and CAS(0, 1) for elements of an array RR. (In practical implementations, all shared memory variables generally support the same set of atomic hardware instructions, which commonly include all the ones used in this paper.)

Adversary

Our algorithm is randomized, meaning that at any point a process can generate a (private) random number by performing a random choice step. The adversary determines the order in which processes take steps, by deciding at any point during the execution, the next process to take a step. We assume the same adversary used in [9], the weak adaptive adversary, where a process always performs its next shared memory operation immediately after a random choice step. I.e., while the weak adaptive adversary knows all past random choices and adapts to them, it cannot intervene between a process’s random choice and its following shared-memory step. Even though we employ randomization, all correctness properties such as linearizability [22] and preserving quiescent history independence (QHI) are achieved deterministically, i.e., they hold for all executions, regardless of the random choices made.

Sequential Specification

This section closely follows Section 2.1 of [9], with all operations other than Write() defined in the same way as in that paper.

An abstract object (also known as type) is a quintuple (Q,q0,I,R,δ)(Q, q_0, I, R, \delta), where QQ is a set of states, q0q_0 is the initial state, II and RR are sets of operations and responses, respectively, and δ:Q×I→Q×R\delta: Q \times I \to Q \times R is the transition function. This quintuple is also called the sequential specification of the object, as it defines the set of possible sequential executions: Whenever an object is in state qq and operation ii is invoked, δ(q,i)=(q′,r)\delta(q,i) = (q',r) defines the operation’s response rr and resulting new state q′q'.

To specify the abstract object writable LL/SC, we follow the definitions in [6, 9, 25]. Each state is a pair (v,L)(v,\mathcal{L}), where vv is the object’s value and L\mathcal{L} is an nn-bit sequence (ℓ1,…,ℓn)(\ell_1,\ldots,\ell_n), called context. Initially, ℓ1=⋯=ℓn=0\ell_1 = \cdots= \ell_n = 0, and the initial value of vv can be defined arbitrarily. We say that pp has an open link to the LL/SC object whenever ℓp=1\ell_p = 1.

A Read() returns the value vv of the object. An LL() (“load-linked”) call by process pp sets ℓp\ell_p to 1 and returns the value vv. A Write(x) operation by process pp unconditionally changes the state of the object to (x,(0,…,0))(x,(0,\ldots,0)) and does not return anything. An SC(x) (“store-conditional”) operation by process pp succeeds if ℓp=1\ell_p = 1, in which case it changes the state of the object to (x,(0,…,0))(x,(0,\ldots,0)) (like Write(x)) and returns True. If ℓp=0\ell_p = 0, then the operation fails and returns False without changing the state of the object. Operation CL() (“clear link”) by process pp simply resets ℓp\ell_p to 0, and does not return anything. Finally, operation VL() (“verify link”) by process pp returns a Boolean value that is true if and only if $\ell_p = 1.

In this paper, we implement a collection of mm writable LL/SC objects, and refer to the ii-th such object as LiL_i. Thus, the abstract object’s state is the cross product of the states of mm individual LL/SC objects. As such, each operation has one additional parameter that indicates which of the LL/SC objects in the collection is affected. For example, operation Write(i, x) behaves as the Write(x) operation defined above, affecting only LiL_i, the ii-th LL/SC object in the collection.

Outstanding LL() Operations

Our implementation requires knowledge of the number of processes and the number of outstanding LL() operations per process, which we formally define next:

Definition 2 (Outstanding LL() Operation). A process pp has an outstanding LL() operation on LiL_i at point tt if and only if

  • pp has no pending method call on LiL_i at point tt, and

  • pp has called LL(i) before point tt without having subsequently invoked a Write(i, ·), SC(i, ·), or CL(i) call, or a VL(i) call that returns False.

Equivalently, we say that pp has an outstanding LL(i) at point tt.

The definition of outstanding LL() operations is similar to that of [9], except that calls to Write(i, ·) clears any outstanding LL(i), and we do not consider a process with a pending call on LiL_i to have an outstanding LL(i).

In our implementation, kk is a per-process bound on the number of outstanding LL() operations (as opposed to a global bound, as in [9]). As such, we require that when LL(i) is called, the calling process has fewer than kk outstanding LL() operations to objects other than LiL_i.

As with [9], our implementation requires that processes clear their outstanding LL(i) operations with CL(i) if they are no longer needed before returning from methods, in order to achieve our space bounds and preserve QHI.

Implementation

Intuition for Changes from Non-Writable QHI-Preserving LL/SC

At a very high level, the non-writable LL/SC implementation of [9] works by storing the value of the ii-th LL/SC object, LiL_i, together with a non-negative bounded tag in an array entry L[i]L[i].

An array RR has one element per nonzero tag gg: R[g]R[g] stores the usage count of tag gg, which is the number of outstanding LL() operations that have read tag gg from the tag field of some element of LL. (Tag zero is the default value, and as such is treated differently, including not needing a usage count.) An LL(i) call increments R[g]R[g] if it reads that L[i].tag=g≠0L[i].\mathrm{tag}=g\ne0. A nonzero usage count signals that a process has protected that tag, and that it should not be reused while protected. An SC(i, ·) call randomly probes elements of RR until it finds a new tag g′g' such that it reads R[g′]=0R[g']=0. A usage count of zero indicates that g′g' is not protected, and it is hence safe to change L[i].tagL[i].\mathrm{tag} to g′g' without causing an ABA problem. Any operation that clears an outstanding LL() operation then decrements the usage count of its associated tag.

Another array CC has one element per LL/SC object: C[i]C[i] stores the activity count of LiL_i, which is the number of processes with a pending method call on LiL_i or that have an outstanding LL(i). When C[i]C[i] reaches zero, it is safe (and necessary for preserving QHI) to reset L[i].tagL[i].\mathrm{tag} to zero, since there is no outstanding LL(i)\mathrm{LL}(i) and therefore no ABA problem to guard against. A nonzero activity count can thus be roughly thought of as protecting tag zero from being used in non-quiescent states.

For more thorough explanations, see the high- and low-level descriptions in § 3 of [9].

We now explain the motivation for how to change the algorithm of [9] to allow for randomized wait-free Write() operations, and the necessary changes required to maintain correctness, the same asymptotic step and space complexity, and to preserve quiescent history independence.

The primary difference in our implementation from that of [9] is in how we manage the usage counts in array RR. As with [9], when a process performs LL(i) on LL/SC object LiL_i and sees a nonzero tag gg, it increments usage count R[g]R[g]. (The default tag zero does not have a usage count, and its ABA prevention comes from activity counts in array CC).

Recall that in [9], an SC(i, ·) call randomly probes elements of RR until it reads zero for some R[g′]R[g']—this implies that, at the time of the read, tag g′g' is not protected. However, it is possible that tag g′g' becomes protected by the time the SC() call attempts a CAS() on L[i]L[i], which if successful would change L[i].tagL[i].\mathrm{tag} to the protected tag g′g', thus potentially causing an ABA problem. But, a process only protects tag g′g' if it sees that L[i].tag=g′L[i].\mathrm{tag}=g', implying that L[i]L[i] changes before the attempted CAS() on L[i]L[i]. Moreover, the process calling SC(i, ·) is itself protecting a tag gg from its own outstanding LL(i) that it read from L[i].tagL[i].\mathrm{tag}. It uses tag gg in its CAS attempt, i.e., the CAS() is from (⋅,g)(\cdot,g) to (⋅,g′)(\cdot,g'). Thus, the only way for the CAS() to succeed is if L[i].tagL[i].\mathrm{tag} changes from gg to g′g' and back to gg, i.e., by an earlier ABA. Since SC() is the only method in their implementation which can modify L[i]L[i], and since it cannot cause the first ABA, it follows that it cannot cause any ABA (see their Lemma 17). Crucially, their argument relies on only SC() calls modifying L[i]L[i], and that L[i]L[i] is only modified via CAS() operations.

Like SC(i, ·), an added Write(i) operation should also choose a new tag that no processes’ currently outstanding LL(i) has seen, in order to prevent ABAs for those processes’ SC(i, ·) operations. Unlike SC(), however, Write() always succeeds and does not require a preceding LL(), while still being (randomized) wait-free. This means that simply verifying that a usage count is zero is no longer sufficient: A process pp executing a Write(i, ·) operation could fall asleep after reading R[g]=0R[g]=0, after which tag gg could become used in L[i].tagL[i].\mathrm{tag} from another SC(i, ·) or Write(i, ·) operation. Since we require that Write() is a randomized wait-free method which unconditionally updates LiL_i, there must be some step in its operation in which it updates L[i]L[i] with some nonzero probability, along with updating L[i].tagL[i].\mathrm{tag} to a new, unprotected tag. But since a Write() call does not know that gg is still unprotected before its update to L[i]L[i] after having only read that R[g]=0R[g]=0, any such update to L[i]L[i] can potentially lead to ABAs. (In contrast, an SC() attempts a CAS(), and this is guaranteed to fail if L[i]L[i] had changed, as argued earlier.)

Instead, our approach is for pp to prevent its chosen tag gg from being used by any concurrent Write() or SC() operation by replacing a read of zero with an R[g].CAS(0,1)R[g].\mathrm{CAS}(0,1) operation. This effectively locks the tag for exclusive use by pp until R[g]R[g] is eventually decremented back to zero. Following [9], we assume that processes are scheduled by the weak adaptive adversary which cannot intervene in between a random choice and the next shared-memory step. Thus, after a random choice of a new tag gg, we immediately follow it by an R[g].CAS(0,1)R[g].\mathrm{CAS}(0,1) attempt, which succeeds with constant probability as long as we have sufficiently many unused tags to choose from. We call such a successful CAS() on R[g]R[g] locking tag gg by the calling process (this lock does not compromise randomized wait-freedom, since our algorithm guarantees a constant success probability with each randomly probed tag). A Write(ii, uu) call can then unconditionally write this new tag gg and its value uu into L[i]L[i]. We also need to prevent Write() calls from using the same tag chosen by concurrent SC() calls, which can cause ABA’s due to the unconditional nature of Write(): We therefore change the SC() method to attempt a CAS(0, 1) for each randomly selected tag until it succeeds, exactly like the Write() method.

In order to ensure history independence and allow for eventual safe recycling of tags, this additional increment of R[g]R[g] must eventually be decremented before the system enters a quiescent state. In the case of a failed SC() operation, the calling process can safely decrement the usage count for its selected tag immediately, since it is not used anywhere else.

However, consider what happens if we decrement R[g]R[g] at the end of a Write(ii, ·) or successful SC(ii, ·) call. If some other crashed process keeps C[i]>0C[i] > 0, indicating a non-quiescent state, then L[i].tagL[i].\mathrm{tag} is not reset to zero, in which case we could have L[i].tag=gL[i].\mathrm{tag} = g and R[g]=0R[g] = 0 when a Write() or SC() call responds. This scenario is not a problem in [9], when only SC() operations can change LL/SC objects. In our case, however, a new Write() call could re-lock tag gg, reaching a configuration with a pending Write() operation poised to write gg back into L[i].tagL[i].\mathrm{tag}, while L[i].tag=gL[i].\mathrm{tag} = g. This scenario violates the sequential specification, because Write(ii, ·) should set all context bits of LiL_i to zero, causing concurrent SC(ii, ·) operations to fail; writing back the same value-tag pair is instead invisible to all other processes. Also, a Write(ii, ·) call poised to overwrite L[i]L[i] could revert a changed value-tag pair, which again leads to an undetected ABA, invisible to concurrent LL(ii) operations regardless of which tags they protect.

While it is tempting to have Write() calls simply double-check that L[i].tag≠gL[i].\mathrm{tag} \ne g after locking gg, this would in the worst case require a lock-free loop that cannot guarantee wait-freedom. (Recall that we only prevent the weak adaptive adversary from interfering in between a random choice and the immediate next step, whereas this last idea would require two shared-memory steps to be uninterrupted to achieve randomized wait-freedom.)

Due to these considerations, after locking a nonzero tag gg, we keep it locked for at least as long as L[i].tag=gL[i].\mathrm{tag} = g. This implies that the responsibility to decrement R[g]R[g] shifts from the process with the Write() or successful SC() operation to the one that next changes L[i].tagL[i].\mathrm{tag} to some other tag. After every successful CAS() operation on L[i]L[i] which changes L[i].tagL[i].\mathrm{tag} away from gg, we thus add a decrement of R[g]R[g]. Since the Write() operation needs to unconditionally change L[i]L[i] and also know the previous tag stored in L[i].tagL[i].\mathrm{tag} before overwriting it, we use the Swap() instruction to read the previous tag. Thus, the Write() method also decrements R[g]R[g] after reading nonzero gg from L[i].tagL[i].\mathrm{tag} after a Swap(), without losing randomized wait-freedom.

Since Write() and SC() now increment usage counts, and the responsibility for decrementing the counts shifts to other processes, analyzing contributions to usage counts becomes more complicated. A side effect of keeping tags locked by LL/SC objects is that each object is now guaranteed to store a unique tag if it is nonzero (i.e., distinct LL/SC objects do not share the same nonzero tag). This property is not directly needed for correctness, complexity, or preserving QHI, but it does reduce the maximum value that elements of RR need to store to n+1n + 1, compared to knkn in [9].

Because objects now contribute to usage counts, it may initially appear that we need Ω(m)\Omega(m) more tags, and hence Ω(m)\Omega(m) more elements of RR, so that the choice of a random tag still succeeds with constant probability. However, recall that, to preserve QHI, we reset all tag fields to zero for each object that does not have a pending method call or an outstanding LL() operation on it. As such, we can show (Lemma 22) that every LL/SC object LiL_i with a nonzero tag field is associated with some process that either has a pending method call on LiL_i or has an outstanding LL(). Since there are nn processes and at most knkn outstanding LL() operations, the extra number of used tags is at most (k+1)n(k+1)n. In total, including the factor of 2 to ensure that at least half of the tags are unused, 4(k+1)n4(k+1)n nonzero tags, only a constant factor more than the 2kn2kn nonzero tags required in [9].

This observation only holds when using the QHI-preserving version of the algorithm: as with [9], our implementation can be made simpler by dropping that requirement, but then the number of required tags becomes 2((k+1)n+m)2((k+1)n+m). Conversely, if Write(i,⋅)(i,\cdot) is only invoked when the calling process has fewer than kk outstanding LL() operations, then this bound decreases slightly to (4k+2)n(4k+2)n. Regardless, all such variants of the implementation use Θ(kn+m)\Theta(kn+m) total base objects.

Lastly, to preserve QHI, the Write() method must change the tag field to zero if the activity counter is zero, using the same mechanism as in [9] in their CL() method. However, since the Write() method does not involve any outstanding LL() operation, it does not need to do the bookkeeping work of clearing information related to outstanding LL() operations like in that paper’s CL() method. Since the Write() method also does not guard against an ABA problem, it has no need to increment (or decrement) the activity counter itself: It only needs to check whether the counter is zero and, if so, to try to change the LL/SC object’s tag field to zero. As such, we split CL() into a shorter CL() method plus a cleanup() method: the former handles clearing outstanding LL() operations, and the latter attempts to reset tag fields to zero before entering a quiescent state.

Low-Level Description

In this section, we present and explain the pseudocode for our implementation, including the parts that are unchanged from [9]. When the details are the same, we explain them similarly.

We store the values of the LL/SC objects in an array LL of CAS objects. In addition, each CAS object stores a non-negative bounded tag that is initialized to zero. The array RR is used to count each tag’s usage, so that R[g]R[g] counts the number of processes that have an outstanding LL() operation that read the tag gg, plus the number of objects with gg in their tag field. The purpose of usage counts is to prevent ABAs. Array CC is an activity counter for LL/SC objects, so that C[i]C[i] tracks how many processes have an outstanding LL(ii); its purpose is to detect quiescent states, and thus help preserve quiescent history independence.

In any LL/SC implementation, processes need some way to keep track of their outstanding LL() operations, in order to be able to know whether their SC() and VL() calls should succeed. Here, processes use a local dictionary dd, which stores, for each LL/SC object LiL_i, a pair consisting of the last value and tag read from L[i]L[i], or the empty value ⊥\perp if the process has no outstanding LL(ii). (The SC(i,⋅i,\cdot), VL(ii), and CL(ii) methods each return immediately when d[i]=⊥d[i]=\perp, since they are only meaningful for a process with an outstanding LL(ii).)

Changes or additions relative to [9] are indicated in blue. Our implementation uses 4(k+1)n4(k+1)n tags rather than 2kn2kn as in [9], or slightly over twice as many tags. On the other hand, in this version tags are never shared between distinct LL/SC objects, the elements in RR need only store values up to n+1n+1 rather than knkn. In addition to adding a Write() method relative to [9], we also move the tag field-resetting functionality of CL() into a new helper method called cleanup(). Since cleanup() is only a helper method, it is not called directly, and as such is not mentioned in the sequential specification.

Constants:

  • UU is the set of values that LL/SC objects can have

  • mm is the number of LL/SC objects

  • nn is the number of processes

  • kk is the maximum number of outstanding LL() operations per process

Shared Data:

  • L[i]L[i] for i∈{1,…,m}i \in\{1,\ldots,m\} is a CAS/Swap object storing a pair in U×{0,1,…,4(k+1)n}U \times\{0,1,\ldots,4(k+1)n\}

  • C[i]C[i] for i∈{1,…,m}i \in\{1,\ldots,m\} is a FAID object storing a number in {0,…,n}\{0,\ldots,n\}

  • R[g]R[g] for g∈{1,…,4(k+1)n}g \in\{1,\ldots,4(k+1)n\} is a FAID/CAS object storing a number in {0,…,n+1}\{0,\ldots,n+1\}

Process-local static data:

  • dd is a dictionary storing keys in {1,…,m}\{1,\ldots,m\} and values in U×{0,1,…,4(k+1)n}U \times\{0,1,\ldots,4(k+1)n\}

Initialization:

  • L[i]←(ui,0)L[i] \gets(u_i,0), where uiu_i is an application-dependent initial value from UU

  • C[i]←0C[i] \gets0

  • R[g]←0R[g] \gets0

  • dd starts empty for each process (all indexing returns ⊥\perp)

LL() Method

The LL() method is unchanged from that of [9].

Since processes can have at most one outstanding LL(ii), line 1 ensures that any previous outstanding LL(ii) is cleared by an internal CL(ii) call (line 15 of Write() serves a similar purpose). The calling process pp then increments C[i]C[i] in line 2, which announces that a process has created an outstanding LL(ii), and tells processes not to reset L[i]L[i].tag to zero. Next, pp reads the value-tag pair stored in L[i]L[i] (line 3), and stores it in its local dictionary dd (line 4), to use in later SC(i,⋅i,\cdot) or VL(ii) calls. If the tag is the default tag of zero, then the call can respond immediately (line 5), because the SC() and Write() methods do not choose tag zero as their new tag, and a nonzero C[i]C[i] prevents ABAs to tag zero. Otherwise, pp reads a nonzero tag gg and increments the corresponding usage count R[g]R[g] (line 6), then reads L[i]L[i] again to confirm that it has not changed (line 7).

If L[i]L[i] has not changed upon the second read, then we say that pp has successfully protected the tag from being reused (see the formal definition in Definition 15), and pp returns in line 8, linearizing in line 7. This protection lasts until pp next invokes CL(ii), as line 35 decrements the usage count again. As we later discuss in the SC() method, the algorithm guarantees that a tag is only reused when no process protects it.

Otherwise, L[i]L[i] has changed to a different value by the time pp reads it in line 7. If L[i]L[i].tag has changed to zero, then pp can return once it has reverted its increment of R[g]R[g] (line 10) and updated its dictionary (line 11), again because tag zero is protected by a nonzero activity count in C[i]C[i]. Otherwise, we take advantage of the fact that an SC(i,⋅i,\cdot) is required to fail if there was an intervening Write(i,⋅i,\cdot) or SC(i,⋅i,\cdot) in between a process’s LL(ii) and SC(i,⋅i,\cdot). We thus retroactively set pp’s LL(ii) call’s linearization point (which defines the order of the execution’s linearization) to the first read in line 3 to satisfy the sequential specification. (Although this is a standard trick for LL/SC implementations, this retroactive linearization point prevents this LL() implementation from being strongly linearizable [16].) The CL(ii) call in line 13 sets d[i]d[i] to ⊥\perp (line 36), as though pp had no outstanding LL(ii), which forces pp’s

LL(i ∈ {1, . . . , m})
1 if d[i] ≠ ⊥ then CL(i)
2 C[i].FAI()
3 (val, tag) ← L[i].Read()
4 d[i] ← (val, tag)
5 if tag = 0 then return val
6 R[tag].FAl()
7 (val′, tag′) ← L[i].Read()
8 if (val, tag) = (val′, tag′) then return val′
9 if tag′ = 0 then
10     R[tag].FAD()
11     d[i] ← (val′, 0)
12     return val′
13 CL(i)
14 return val
Write(i ∈ {1, . . . , m}, u ∈ U)
15 if d[i] ≠ ⊥ then CL(i)
17 repeat
18     tag′ ← independent uniform random sample from {1, . . . , 4(k + 1)n}
19 until R[tag′].CAS(0, 1) = True
20 (·, tag) ← L[i].Swap((u, tag′))
21 if tag ≠ 0 then R[tag].FAD()
22 if C[i].Read() = 0 then cleanup(i)

following SC(i,⋅i,\cdot) to fail in line 23. (In this case, pp still does have an outstanding LL(ii) by definition, because the fact that the next SC(i,⋅i,\cdot) will fail is not yet directly visible by an algorithm using our LL/SC implementation.)

Write() Method

In lines 17–19 of a Write(i) call, the calling process pp repeatedly probes random tags in the range of possible tags. Specifically, line 18 chooses an independent and uniform random tag value in the domain of 4(k+1)n4(k+1)n possible tags. The calling process attempts a CAS() from zero to one for the chosen tag’s usage count, and repeats this random choice if the CAS() fails, until it eventually succeeds in incrementing some usage count. There are 4(k+1)n4(k+1)n tags, and as argued in the end of Section 3.1 and proven in Lemma 22, there are at most 2(k+1)n2(k+1)n tags with nonzero usage count at any given time. Because the weak adaptive adversary cannot intervene between the random choice in line 18 and the CAS() attempt in line 19, each CAS() attempt succeeds with probability at least 1/21/2. Thus, the number of loop iterations is dominated by a geometrically distributed random variable with parameter 1/21/2, and thus has expectation at most 2.

With a successful R[g].CAS(0, 1) for some nonzero tag gg, pp locks gg so that no other Write() or SC() call can use it, and gg then remains locked for as long as it is used in L[i].tag. Process pp then calls Swap() on L[i] in line 20 to write its new value together with the locked tag gg, which serves as the linearization point of the method. Immediately after this point,

SC($i \in \{1,\ldots,m\}$, $u \in U$)
23  if $d[i] = \perp$ then return False
25  repeat
26      $tag' \leftarrow$ independent uniform random sample from $\{1,\ldots,4(k+1)n\}$
27  until $R[tag'].CAS(0,1) = \mathrm{True}$
28  $result \leftarrow L[i].CAS(d[i],(u,tag'))$
29  if $result = \mathrm{True}$ and $d[i].tag \ne 0$ then $R[d[i].tag].FAD()$
30  if $result = \mathrm{False}$ then $result \leftarrow L[i].CAS((d[i].val,0),(u,tag'))$
31  if $result = \mathrm{False}$ then $R[tag'].FAD()$
32  CL($i$)
33  return $result$

we say that tag gg is locked by LiL_i, because L[i].tag=gL[i].\mathrm{tag}=g. Since pp had locked its nonzero tag gg, and the previous value of L[i].tagL[i].\mathrm{tag} was either previously locked by LiL_i or was zero, it is guaranteed that this Swap() operation changes L[i].tagL[i].\mathrm{tag} to a different value. This in turn guarantees that any outstanding LL(ii) by other processes detects that the Write() has linearized, preventing undetected ABAs. Since the previous tag, returned from Swap(), is no longer used in L[i].tagL[i].\mathrm{tag}, pp then decrements its usage count (in line 21) so that it can eventually be unlocked and used again once the usage count reaches zero. (If there are outstanding LL(ii) operations by other processes which have seen tag gg, then they contribute to the usage count R[g]R[g], and so the tag is not fully unlocked until each of them have called CL(ii).)

Lastly, pp checks if the activity counter C[i]C[i] is zero, in which case it is safe to reset the tag to zero via a cleanup(ii) call (line 22) to preserve QHI. Note that Write(ii) does not increment (or decrement) C[i]C[i], because it changes L[i]L[i] unconditionally unlike SC(), without needing ABA prevention for its own operation.

Because this method linearizes at a Swap() call, it can be transformed into a Swap() implementation by returning the previous value of L[i].valL[i].\mathrm{val} read (and ignored) in line 20.

SC() Method

Line 23 ensures that an SC() call returns False in the case of the calling process not having any outstanding LL() (lines 34 of CL() and 47 of VL() serve a similar purpose). Lines 25–27 work just like lines 17–19 to lock an unprotected tag for exclusive use by the calling process. Recall that d[i]d[i] stores the previous value-tag pair read from L[i]L[i] in a previous LL(ii) operation. Line 28 thus attempts a CAS() from the previous value-tag pair stored in d[i]d[i] to the new value (the second argument of SC()) and the newly chosen tag. Similarly to line 21, line 29 unlocks the nonzero tag previously stored in L[i]L[i] after a successful CAS() in line 28, so that it can eventually be recycled.

Although a nonzero activity counter (C[i]C[i]) prevents CL() calls from resetting L[i].tagL[i].\mathrm{tag} to zero (as we detail below), there is an edge case of a CL() call poised to clear L[i].tagL[i].\mathrm{tag} from before a time when C[i]C[i] was incremented. As such, line 30 tries another CAS() from a tag of zero, in case L[i].tagL[i].\mathrm{tag} was reset to zero in between the previous LL(ii) operation’s linearization point and the CAS() attempt in line 28. If both CAS() attempts fail, then line 31 unlocks the newly chosen tag, since it was not successfully used. (In this case, the usage count immediately hits zero, since no other process would have seen the tag—line 31 could be replaced with a Write() of zero, but this is somewhat less intuitive in the code.)

The method linearizes at the point of its last CAS() attempt on L[i]L[i] in either line 28

CL($i \in \{1,\ldots,m\}$)
34 if $d[i] = \perp$ then return
35 if $d[i].\mathrm{tag} \ne 0$ then $R[d[i].\mathrm{tag}].\mathrm{FAD}()$
36 $d[i] \leftarrow \perp$
37 if $C[i].\mathrm{FAD}() = 1$ then cleanup($i$)

cleanup($i \in \{1,\ldots,m\}$)
38 $(val, tag) \leftarrow L[i].\mathrm{Read}()$
39 if $tag = 0$ then return
40 $R[tag].\mathrm{FAI}()$
41 if $L[i].\mathrm{Read}() = (val, tag)$ then
42 if $C[i].\mathrm{Read}() = 0$ then
43 if $L[i].\mathrm{CAS}((val, tag),(val, 0)) = \mathrm{True}$ then
44 $R[tag].\mathrm{FAD}()$
45 $R[tag].\mathrm{FAD}()$

or 30, then calls CL() in line 32 to clear the calling process’s outstanding LL(), and returns whether its last CAS() attempt succeeded.

CL() and cleanup() Methods

After confirming that a CL(ii) call is nontrivial (line 34), the call ends the calling process pp’s protection of a nonzero tag by decrementing that tag’s usage count (line 35) and clears pp’s dictionary entry for LiL_i (line 36), ending pp’s outstanding LL(ii). Next, pp decrements the activity counter for LiL_i (line 37), announcing that its outstanding LL(ii) has been cleared. If the counter decrements from one to zero, then pp has the responsibility to reset L[i].tagL[i].\mathrm{tag} to ensure QHI, which it does via the cleanup() method.

Method cleanup(ii) is called by either CL(ii) as just explained, when C[i]C[i] is decremented to zero, or by Write(ii) (line 22) when reading zero from C[i]C[i]. In both cases, the calling process pp has (at some point before invoking cleanup(ii)) the responsibility to reset L[i].tagL[i].\mathrm{tag} to zero, unless L[i]L[i] changes again.

Lines 38, 40, and 41 work the same way as lines 3, 6, and 7 of LL() to try to protect the current tag gg stored in L[i].tagL[i].\mathrm{tag}, preventing pp from resetting L[i].tagL[i].\mathrm{tag} after an ABA. If gg is zero then pp can return immediately (line 39). If L[i].tagL[i].\mathrm{tag} changes from gg, then CL(ii) no longer needs to reset L[i].tagL[i].\mathrm{tag}, so it simply decrements its usage count, ending its protection of tag gg (line 45). Otherwise, pp next double-checks that the activity counter C[i]C[i] is still zero (line 42). This second check of C[i]C[i] ensures that any process which changes L[i].tagL[i].\mathrm{tag} does so after pp’s execution of line 42, while gg is protected. Lines 43 and 44 work similarly to lines 28 and 29 of SC(): pp attempts to CAS() L[i].tagL[i].\mathrm{tag} from gg to zero, and if successful pp then decrements tag gg’s usage count since gg is no longer used in L[i].tagL[i].\mathrm{tag}. (Note that, in the case of a successfully reset tag, pp decrements R[g]R[g] twice, in lines 44 and 45: The first decrements LiL_i’s usage count associated with the initial lock in line 19 or line 27, whereas the second ends pp’s protection of the tag.)

Read($i \in \{1,\ldots,m\}$)
46 return $L[i]$.Read().val
VL($i \in \{1,\ldots,m\}$)
47 if $d[i] = \bot$ then return False
48 if $L[i]$.Read().tag $\in \{d[i]$.tag, 0\} then return True
49 CL($i$)
50 return False

Read() and VL() Methods

The Read() and VL() methods are the same as in [9].

A Read(ii) call simply returns the contents of L[i]L[i].val, as it has no need to do anything with the tag field.

Conversely, a VL(ii) call only checks L[i]L[i].tag in line 48, linearizing at the point of the read. If VL(ii) is called by a process pp with an outstanding LL(ii) (which is the intended case, as it would otherwise return in line 47), then pp would have already protected the tag that it read earlier and stored in d[i]d[i].tag. This protection prevents ABAs while pp has an outstanding LL(ii), and therefore if L[i]L[i].tag = d[i]d[i].tag then it also follows that L[i]L[i] did not change in between the linearization points of LL(ii) and VL(ii). VL(ii) also checks if L[i]L[i].tag = 0 because of the same edge case discussed for SC() in Section 3.2.3. If L[i]L[i].tag is a different nonzero value, then pp does not have an open link to LiL_i, and so pp calls CL(ii) in line 49 to also clear its outstanding LL(ii).

Analysis

This section formally proves Theorem 1. Several proofs closely follow the format of those of [10], but with significant changes throughout due to adding the Write() operation and making the required changes to SC() and CL().

Lemma 3. When a process responds from a CL(ii), Write(i,⋅i,\cdot), or SC(i,⋅i,\cdot) call, its value of d[i]d[i] is ⊥\bot.

This lemma corresponds to Lemma 1 of [10], and its proof is mostly unchanged, except that it also applies to Write(i,⋅i,\cdot).

Proof. For CL(ii), if the calling process pp returns in line 34, then the lemma is satisfied by the if-condition in that line. Otherwise, pp sets d[i]d[i] to ⊥\bot in line 36 and does not change it again (including in cleanup(ii), if called) until its response.

For Write(i,⋅i,\cdot), if d[i]≠⊥d[i] \ne\bot upon invocation, then the calling process pp calls CL(ii) in line 15, which by the above ensures that d[i]=⊥d[i] = \bot by its response. The rest of the call does not change d[i]d[i] again, including in a possible call to cleanup(ii).

For SC(i,⋅i,\cdot), if the calling process pp returns in line 23, then the lemma is satisfied by the if-condition in that line. Otherwise, pp calls CL(ii) in line 32, which by the above ensures that d[i]=⊥d[i] = \bot by its response, and then immediately returns.

Lemma 4. If d[i]≠⊥d[i] \ne\bot for a process pp while pp does not have a pending method call on LiL_i, then pp has an outstanding LL(ii).

This lemma corresponds to Lemma 2 of [10], and its proof is mostly unchanged.

Proof. Only LL⁡(i)\operatorname{LL}(i) can set d[i]d[i] to a non-⊥\perp value. By Lemma 3, the CL⁡(i)\operatorname{CL}(i), Write⁡(i,⋅)\operatorname{Write}(i,\cdot), and SC⁡(i,⋅)\operatorname{SC}(i,\cdot) methods ensure d[i]=⊥d[i]=\perp by their respective responses. If a VL⁡(i)\operatorname{VL}(i) call returns False, then either d[i]=⊥d[i]=\perp in line 47, or it calls CL⁡(i)\operatorname{CL}(i) in line 49, so in both cases d[i]=⊥d[i]=\perp by the point it returns False. Thus, if d[i]≠⊥d[i]\ne\perp while pp is idle, then pp has called LL⁡(i)\operatorname{LL}(i) and not subsequently called Write⁡(i,⋅)\operatorname{Write}(i,\cdot), SC⁡(i,⋅)\operatorname{SC}(i,\cdot), CL⁡(i)\operatorname{CL}(i), or a VL⁡(i)\operatorname{VL}(i) call which returns False, so by Definition 2 pp has an outstanding LL⁡(i)\operatorname{LL}(i).

Contributions to Counters

The following definition corresponds to Definition 3 of [10], but is more complicated because LL/SC objects can now contribute to elements of RR, with said contribution able to transfer between processes and LL/SC objects. Intuitively, a contribution by pp to R[g]R[g] represents pp’s responsibility for eventually decrementing the value of R[g]R[g]. That responsibility is initially generated by pp’s increment of R[g]R[g] (from a FAI⁡()\operatorname{FAI}() or a successful CAS⁡(0,1)\operatorname{CAS}(0,1)). When a process installs a new tag to L[i].tag⁡L[i].\operatorname{tag} for some object LiL_i, it transfers that responsibility to LiL_i. When L[i].tag⁡L[i].\operatorname{tag} is subsequently replaced by a process, the responsibility transfers to the replacing process, which then performs the decrement of R[g]R[g].

Definition 5 (Contribution). Given a point tt, a process pp, and element C[i]C[i], pp contributes jj to C[i]C[i]’s value, if jj is the number of FAI⁡()\operatorname{FAI}() minus FAD⁡()\operatorname{FAD}() operations that pp has executed on C[i]C[i] before tt.

For each element R[g]R[g], processes increase their contributions by performing a FAI⁡()\operatorname{FAI}() or a successful CAS⁡(0,1)\operatorname{CAS}(0,1) operation on R[g]R[g], and decrease their contribution to R[g]R[g] by performing a FAD⁡()\operatorname{FAD}() operation on R[g]R[g]. In addition, contributions to R[g]R[g] can also transfer between processes and LL/SC objects, without changing the total contribution to or the value of R[g]R[g], as follows:

  • Suppose a process pp executes an L[i].Swap⁡(⋅,g)L[i].\operatorname{Swap}(\cdot,g) operation in line 20 or a successful L[i].CAS⁡(⋅,(⋅,g))L[i].\operatorname{CAS}(\cdot,(\cdot,g)) operation in line 28 or 30 at point tt. Then, pp’s contribution to R[g]R[g]’s value decrements by one and LiL_i’s contribution to R[g]R[g]’s value increments by one at point tt.

  • Suppose a process pp reads (⋅,g)(\cdot,g) from an L[i].Swap⁡(⋅)L[i].\operatorname{Swap}(\cdot) operation in line 20, or executes a successful L[i].CAS⁡((⋅,g),⋅)L[i].\operatorname{CAS}((\cdot,g),\cdot) operation in line 28 or 43 at point tt. Then, pp’s contribution to R[g]R[g]’s value increments by one and LiL_i’s contribution to R[g]R[g]’s value decrements by one at point tt.

Lemma 6. When a process pp invokes or responds from a method call, including the helper method cleanup⁡()\operatorname{cleanup}(),

(a) if d[i]=⊥d[i]=\perp, then pp contributes zero to C[i]C[i], and otherwise pp contributes one to C[i]C[i], and

(b) the total contribution to R[g]R[g] by pp, for g∈{1,…,4(k+1)n}g\in\{1,\ldots,4(k+1)n\}, equals the number of non-⊥\perp values in pp’s dictionary dd which have gg as their tag.

At all points in the execution,

(c) the number of objects LiL_i for which d[i]≠⊥d[i]\ne\perp for pp is at most kk,

(d) pp contributes either zero or one to each individual element of CC, and

(e) pp contributes a total value in {0,…,k+2}\{0,\ldots,k+2\} to the elements of RR, with a non-negative contribution to each individual element.

This lemma corresponds to Lemma 4 of [10], but (e) is a per-process bound and includes a lower bound of zero, with a global lower bound proven later in Corollary 9.

Proof. Note that by Definition 5, pp’s contributions to RR and CC, as well as its dictionary dd, do not change while pp is idle. Thus, if (a) through (e) hold when pp responds from a method call and becomes idle, then they also hold until the point when pp next invokes a method.

As such, we prove (a) and (b) for a process pp by induction over its method calls, including the helper method cleanup(), while proving that (c) through (e) hold at all points within each of pp’s method calls.

Initially, pp contributes zero to elements of CC and RR and its dictionary dd is empty (all values are ⊥\perp), so (a) through (e) hold before pp’s first method call.

Suppose that (a) through (e) hold for pp before the invocation of a given method: we will prove that (c) through (e) hold throughout the method call, and that (a) and (b) hold at the call’s response.

If the method call is Read(i), then (a) through (e) hold because Read() does not affect pp’s contributions or its dictionary dd.

We next consider the CL(i) method. If the call returns immediately in line 34, then neither pp’s contribution nor dd change, so (a) through (e) remain true. Otherwise, d[i]≠⊥d[i] \ne\perp at invocation, so by (a), pp’s contribution to C[i]C[i] is one at invocation. Since the cleanup(i) method is called as the last step, if it is called at all, it suffices to show that (a) and (b) hold immediately after the FAD() on C[i]C[i] in line 37, and (c) through (e) hold until just after that decrement. Since pp does not set any non-⊥\perp value in dd throughout the method call, (c) remains satisfied. Since pp resets d[i]d[i] to ⊥\perp in line 36 and decrements C[i]C[i] in line 37, pp’s contribution to C[i]C[i] becomes zero which satisfies (a) after the decrement. In particular, pp’s contribution is either zero or one throughout the call, so (d) is satisfied throughout the call.

If d[i].tag⁡=0d[i].\operatorname{tag} = 0 at invocation, then pp does not make any change to RR in line 35, so (b) and (e) remain true throughout the call. Otherwise, d[i].tag⁡d[i].\operatorname{tag} is nonzero at invocation, so by (b) pp contributes at least one to R[d[i].tag⁡]R[d[i].\operatorname{tag}] at invocation. In this case, pp decrements R[d[i].tag⁡]R[d[i].\operatorname{tag}] in line 35, satisfying (b) again after line 36. In particular, since pp’s total contribution to RR is non-negative at invocation by (e), its contribution to R[d[i].tag⁡]R[d[i].\operatorname{tag}] is positive at invocation by (b), and it only decrements R[d[i].tag⁡]R[d[i].\operatorname{tag}], (e) is satisfied throughout the method call. Thus, both cases satisfy (b) and (e).

Next, consider the cleanup(i) helper method. Since it does not modify dd or CC, (a), (c), and (d) remain satisfied. If pp responds in line 45, then it increments and later decrements the value of R[tag⁡]R[\operatorname{tag}] for its local variable tag⁡\operatorname{tag}, in lines 40 and 45, which exactly counteract each other’s effect. If pp executes a successful CAS() in line 43, then (by Definition 5) it increments its contribution to R[tag⁡]R[\operatorname{tag}] for its local variable tag⁡\operatorname{tag}, and then decrements that contribution to R[tag⁡]R[\operatorname{tag}] when pp executes its next step in line 44. Since the method does not modify dd, and any contribution increments are followed by contribution decrements of the same element of RR, (b) holds at pp’s response in line 45 or 39. From (e) and (c), pp’s total contribution to elements of RR is at most kk when invoking cleanup(i). Since pp’s contribution increases at most twice in cleanup(i), and since all decrements of contributions to elements of RR follow increments of that same element in the same method, (e) remains satisfied.

Since the VL() method does not change pp’s contribution to CC or RR or its dictionary dd except via its internal CL() call, (a) through (e) hold for VL() by the above arguments for CL() and cleanup().

We next consider the Write(i,·) method, before the possible call to cleanup(i) in line 22. We have that (a), (c), and (d) remain true throughout the method call, since pp’s dictionary dd and its contribution to CC do not change in the method. By (b) and (c) from the inductive hypothesis, pp contributes at most kk to elements of RR at invocation. Then, pp’s contribution to R[tag′]R[tag'] increments by one at a successful CAS() in line 19, and decrements by one in line 20. If the value tagtag read from L[i].tagL[i].tag in line 20 is nonzero, then pp’s contribution to R[tag]R[tag] increments by one in line 20 and decrements by one in line 21. In both cases, pp’s contributions to elements of RR before line 22 changes back to what they were at invocation, satisfying (b) before line 22. Since pp’s total contribution to RR does not increase by more than one relative to invocation throughout the method call, and all increments are then cancelled out for the same element of RR, (e) remains satisfied throughout the method call.

The arguments for the SC(i, ·) method are similar to those for Write(i, ·), but there are more cases to consider. Here, we need to consider steps, up to just before it calls CL(i) in line 32. Since the steps of SC() excluding CL() do not change the values in dd or pp’s contributions to CC, it again follows that (a), (c), and (d) remain true throughout those steps.

If the SC(i, ·) call returns in line 23, then (b) and (e) also hold throughout the call since the call does not change dd or RR. Otherwise, d[i]≠⊥d[i] \ne\perp at invocation, so we consider the lines up until line 32. Again by (b) and (c) from the inductive hypothesis, pp contributes a non-negative integer of at most kk to the elements of RR at SC(i, ·)’s invocation. Thus, when pp breaks out of its while-loop via a successful CAS(0, 1) in line 27, its contribution to R[tag′]R[tag'] increments by one, and its total contribution to RR is at most k+1k+1 immediately after that line. By Definition 5, that contribution lasts until either a successful CAS() in line 28 or 30, or upon a FAD() in line 31.

If pp has a successful CAS() in line 28, and if d[i].tag≠0d[i].tag \ne0, then pp’s contribution to R[tag′]R[tag'] is decremented and its contribution to R[d[i].tag]R[d[i].tag] is incremented at that point, which does not change pp’s total contribution to RR. Exactly in that case, pp executes the R[d[i].tag]R[d[i].tag].FAD() in line 29, undoing the effect of incrementing its contribution to R[d[i].tag]R[d[i].tag]. By inspection of the code and Definition 5, pp’s contribution to R[tag′]R[tag'] decrements by one in exactly either line 28, 30, or 31, bringing pp’s total contribution to RR back to at most kk.

Since all increments of elements of RR by pp are then decremented for the same element in the method, its contributions immediately before line 32 are the same as at invocation, thus satisfying (b) before line 32. In particular, pp’s contribution to R[tag′]R[tag'] increments by one and then decrements by one, with the decrement possibly happening simultaneously with an increment of the contribution to R[d[i].tag]R[d[i].tag] followed by a corresponding decrement. Therefore, because pp’s total contributions to RR at invocation are in {0,…,k}\{0,\ldots,k\}, and from (e) pp contributes a non-negative value to each element of RR at invocation, (e) remains satisfied throughout the call.

It remains to show (a) through (e) for an LL(i) call by pp. Since they each remain true after CL() calls by the above arguments, they each remain true by the time the LL(i) call reaches line 2.

Since, by Lemma 3, the CL(i) call in line 1 ensures that d[i]=⊥d[i] = \perp, it follows by (a) that pp’s contribution to C[i]C[i] immediately before line 2 is zero, and hence its contribution immediately after the FAI() is one. In particular, at all points pp’s contribution to C[i]C[i] is either zero or one, satisfying (d) throughout the call. After executing line 4, (a) becomes true again, and remains true until pp’s possible invocation of CL(i) in line 13, then remains true at its response by the above arguments for CL(), and therefore (a) is true at any possible response from LL(i). (Note that line 11, if executed, only changes the value of d[i]d[i] from one non-⊥\perp value to another.) Recall from Section 2.4 that pp is required to have at most k−1k-1 outstanding LL() operations to objects other than LiL_i before invoking LL(i). Thus, by Lemma 4, there are at most k−1k-1 objects Lj≠LiL_j \ne L_i such that d[j]≠⊥d[j] \ne\perp for pp before the call’s invocation. Since d[i]=⊥d[i] = \perp after line 1, it follows that after executing line 4, there are at most kk non-⊥\perp values in dd, and so (c) remains true throughout the call. Since (b) holds immediately before pp executes line 2, and the number of non-⊥\perp values in dd is less than kk at that point, it follows that line 6 does not increase pp’s contribution to RR past kk. By the inductive hypothesis and that CL() preserves (e), (e) holds from invocation until just before line 6 (or a response in line 5). It follows that pp’s contribution to R[tag]R[\mathit{tag}] is at least 1 after the FAI() in line 6, and therefore remains non-negative after a possible FAD() in line 10. Therefore, pp’s contribution to RR is in {0,…,k}\{0,\ldots,k\} throughout the LL(i) call, with a non-negative contribution to each element which is more than enough to satisfy (e) throughout the call. Finally, we can verify that (b) holds at each relevant response point and the possible invocation of CL(i) in line 13, using that it holds immediately after line 1 with d[i]=⊥d[i]=\perp at that point. In line 5, d[i].tag=0d[i].\mathit{tag}=0 and RR is untouched by pp; in lines 8 and 13, d[i].tag≠0d[i].\mathit{tag}\ne0 and R[tag]=R[d[i].tag]R[\mathit{tag}]=R[d[i].\mathit{tag}] is incremented; and in line 12, d[i].tag=0d[i].\mathit{tag}=0 and the increment of R[tag]R[\mathit{tag}] is reversed.

Lemma 7. The value of each element in CC equals the sum of the contributions from each process (i.e., no element overflows).

This lemma corresponds to part of Lemma 6 of [10], with the part referring to RR proven later in Lemma 12(a).

Proof. From Definition 5, each FAI() to an element of CC corresponds to an increment of the total contribution to that element. Similarly, each FAD() to an element of CC corresponds to a decrement of the total contribution to that element. Since no other operation affects the value of elements of CC, it suffices to show that the total contribution to each element remains in the range [0,n][0,n], thus never underflowing or overflowing the element’s value. From Lemma 6(d), process contributions to CC are either zero or one at all times. Therefore, each process contributes at most one to the value of each element of CC, and since objects do not contribute to elements of CC, it follows that the maximum contribution to any given element of CC is nn. It follows that the total contribution each element of CC is always in the range [0,n][0,n], implying the lemma.

Lemma 8. At point tt, L[i].tag=g≠0L[i].\mathit{tag}=g\ne0 if and only if LiL_i contributes one to the value of R[g]R[g]. For all g′∉{L[i].tag,0}g' \notin\{L[i].\mathit{tag},0\}, LiL_i contributes zero to the value of R[g′]R[g'] at point $t.

This is a new result, which we use to ensure correctness of the Write() method.

Proof. The only lines that can change LiL_i’s contribution to the value of an element of RR, by Definition 5, are lines 20, 28, 30, and 43. These are also the only lines that can change the value of L[i]L[i]. From Definition 5 and inspection of the code, the cases in which an object increments its contribution to R[g]R[g] for nonzero tag gg and the cases in which L[i].tagL[i].\mathit{tag} changes to nonzero tag gg are the same as each other: Both occur exactly in the event of an L[i].Swap(⋅,g)L[i].\mathrm{Swap}(\cdot,g) operation in line 20 or a successful L[i].CAS(⋅,(⋅,g))L[i].\mathrm{CAS}(\cdot,(\cdot,g)) operation in line 28 or 30. Similarly, from Definition 5 and inspection of the code, the cases in which an object decrements its contribution to R[g]R[g] for nonzero tag gg and the cases in which L[i].tagL[i].\mathit{tag} changes from nonzero tag gg are the same as each other: Both occur exactly in the event of an L[i].Swap(⋅)L[i].\mathrm{Swap}(\cdot) operation in line 20 that returns (⋅,g)(\cdot,g), or a successful L[i].CAS((⋅,g),⋅)L[i].\mathrm{CAS}((\cdot,g),\cdot) operation in line 28 or 43. The above are not (yet) mutually exclusive: if a Swap() or successful CAS() on L[i]L[i] ‘changes’ L[i].tagL[i].\mathit{tag} from gg to gg, then by Definition 5 LiL_i’s contribution to tag gg both increments and decrements by one, and therefore does not change. (We later show in Lemma 14 that this cannot occur, but that result depends on this lemma.) Initially, L[i].tag=0L[i].\mathit{tag}=0 for all ii, and no object contributes anything to any element of RR. From the above observations, it follows that LiL_i increments its contribution to R[g]R[g]’s value for nonzero gg exactly when L[i].tagL[i].\mathit{tag} changes to gg from a different tag. Similarly, LiL_i decrements its contribution to R[g]R[g]’s value exactly when L[i].tagL[i].\mathit{tag} changes from gg to different tag. The first part of the lemma thus follows by induction. Since L[i].tagL[i].\mathit{tag} only has one value, LiL_i can therefore only contribute to at most one element of RR at a time, namely the element R[g]R[g] such that L[i].tag=g≠0L[i].\mathit{tag}=g\ne0, proving the second part.

Corollary 9. At all points of the execution, the total contribution to any given element of CC or RR is non-negative, and it is positive if any process or object contributes a positive value to that element.

This statement is somewhat analogous to Lemma 5 of [10], but proven differently.

Proof. Since only processes contribute to CC, and by Lemma 6(d) they each contribute either zero or one to each element, it follows that the total contribution to CC is non-negative, and positive if any process contributes one. The statement for RR follows from the combination of Lemma 6(e) and Lemma 8.

Locking Tags

An important new concept in this writable LL/SC implementation is that of locking tags. The SC() and Write() methods attempt to lock a tag as defined below to ensure that they do not choose the same new tag as a concurrent SC() or Write() call, which could lead to ABAs as argued in Section 3.1.

Definition 10 (Locked tag). A process pp locks tag g∈{1,…,4(k+1)n}g\in\{1,\ldots,4(k+1)n\} for LiL_i when pp has a successful CAS(0, 1) on R[g]R[g] in either line 19 or 27, as part of an SC(i,⋅i,\cdot) or Write(i,⋅i,\cdot) call. The tag then becomes unlocked when the total contribution to it according to Definition 5 becomes zero.

Lemma 11. While L[i].tag=g≠0L[i].\mathit{tag}=g\ne0, tag gg is locked for LiL_i. When a Swap() or a successful CAS() next takes effect on L[i]L[i], tag gg remains locked until the process that executes that Swap() or CAS() takes its next step.

Proof. Initially, all tag fields are set to zero. Thus, if L[i].tag=g≠0L[i].\mathit{tag}=g\ne0 at point tt, then there is a point t′<tt'<t at which a Swap() in line 20 or a successful CAS() in either line 28 or 30 is executed by some process pp, changing L[i].tagL[i].\mathit{tag} to gg. Let t′t' be the latest such point, so that L[i].tag=gL[i].\mathit{tag}=g throughout (t′,t](t',t]. There is a point tL<t′t_L<t' at which pp executes a successful CAS() in line 19 or 27 on R[g]R[g], changing it from zero to one, and by Definition 5 and Lemma 6(e) increasing pp’s contribution to R[g]R[g] from zero to one. By Definition 10, pp locks tag gg at point tLt_L. From Definition 5, pp’s contribution to R[g]R[g] does not change from tLt_L to t′t', pp’s contribution is transferred to LiL_i at point t′t', and LiL_i’s contribution does not change from t′t' to tt. From Corollary 9, there is a non-negative contribution to R[g]R[g] throughout (tL,t](t_L,t]. Therefore, from Definition 10, tag gg remains locked throughout (tL,t](t_L,t].

Now suppose that point t∗t^* is the first point after tt at which a Swap() in line 20 or a successful CAS() in either line 28 or 43 takes effect on L[i]L[i], and let qq be the process performing that step. L[i].tag=gL[i].\mathit{tag}=g throughout (t′,t∗)(t',t^*), LiL_i’s contribution transfers to qq at point t∗t^* (from Definition 5), and this transferred contribution remains until qq its next step, which is line 21, 29, or 44, at point tU>t∗t_U>t^*. From Corollary 9, there is a positive contribution to R[g]R[g] throughout (tL,tU)(t_L,t_U). The final part of the lemma then follows from Definition 10.

Lemma 12. At each point in the execution,

(a) the value of each element in RR equals the sum of the contributions from each process and LL/SC object,

(b) while a tag is locked, no process can lock it a second time, and

(c) each process contributes at most one to each element of RR, unless a contribution was transferred from an object to the process in either line 20, 28, or 43. In the latter case, the process can contribute at most two to that element until it next executes line 21, 29, or 44, respectively.

Statement (a) corresponds to part of Lemma 6 from [10], with the part referring to CC proven earlier in Lemma 7.

Proof. We prove the three parts as a combined invariant by induction over the execution. They each hold at the beginning of the execution, since no process or object contributes to RR and no tag is locked initially.

We first show (b), by showing that if a tag gg becomes locked at point tt, and (a) holds at all points prior to tt, then gg is not locked immediately before tt. From Definition 10, there is a nonzero total contribution to R[g]R[g] throughout the interval in which tag gg is locked. Since point tt is the point of a successful CAS⁡(0,1)\operatorname{CAS}(0,1) on R[g]R[g], it follows that R[g]=0R[g] = 0 immediately before point tt. From (a), it follows that no process or object contributes to R[g]R[g] immediately before tt, and therefore that gg is not locked immediately before tt.

We next show that (c) holds at point tt, given that (a), (b), and (c) hold at all points prior to point tt. Suppose that a process pp increments its contribution to R[g]R[g] at point tt (otherwise (c) holds immediately by the inductive hypothesis). If this comes from a transfer from an object, i.e., in either line 20, 28, or 43, then by the inductive hypothesis for (c), pp contributes at most one per tag immediately before point tt. Therefore, pp contributes at most two per tag immediately after point tt. In all transferred cases, pp decrements the transferred tag in the next line (line 21, 29, or 44, respectively), from which (c) follows.

Thus, we next consider the cases in which pp directly increments R[g]R[g] at point tt, in either line 6, 19, 27, or 40: in all cases, we will show that pp contributes exactly one to R[g]R[g] immediately after point tt. For lines 19 and 27, since they are CAS⁡(0,1)\operatorname{CAS}(0,1) operations, (c) follows from the inductive hypothesis that (a) holds immediately before tt, and that a total contribution of zero to RR implies zero contribution from each process (from Corollary 9).

The remaining (and most complicated) cases are that pp executes line 6 of an LL⁡(i)\operatorname{LL}(i) call or line 40 of a cleanup(i) call at point tt, which we consider together. Suppose for the purpose of proving a contradiction that pp already contributes at least one to R[g]R[g] immediately before point tt. It follows that there is a point t′<tt' < t at which pp incremented its contribution to R[g]R[g], without decrementing its contribution to R[g]R[g] in (t′,t)(t',t).

Observe that the increments of contribution which can happen in lines 19, 20, 28, and 40 are necessarily followed by a decrement of contribution in lines 20, 21, 29, and 45, respectively, in the same method call. Similarly, the increment of contribution in line 27 is necessarily followed by a decrement of contribution in exactly one of either line 28, 30, or 31. In all the above-considered cases, pp does not execute line 6 or 40. Therefore, the only increment of contribution which is not cancelled out before point tt is that in line 6. Moreover, that call must respond in line 8, otherwise pp's contribution is decremented in either line 10 or line 35 from the CL⁡()\operatorname{CL}() call in line 13. So, there is a point t′<tt' < t at which pp increments R[g]R[g] in line 6 of an LL⁡(j)\operatorname{LL}(j) call, and that pp's contribution to R[g]R[g] stays at one until just before point tt.

Since pp's LL⁡(j)\operatorname{LL}(j) call responds in line 8, there is a point t∗∈(t′,t)t^* \in(t',t) at which pp reads gg from L[j].tagL[j].\mathrm{tag} in line 7. From Lemma 11, gg is locked at point t∗t^* for LjL_j. We next establish that Lj≠LiL_j \ne L_i by contradiction: suppose instead that Li=LjL_i = L_j. Since pp’s contribution to R[g]R[g] is exactly one throughout (t′,t)(t',t), and each method call involves only one element of dd, Lemma 6(b) implies that d[i].tag=gd[i].\mathrm{tag} = g at pp’s method invocations throughout the interval. In the case of executing line 6 at point tt, pp would call CL(j)(j) in line 1 before line 6, and decrement R[g]R[g] in line 35, contradicting that pp does not decrement R[g]R[g] throughout (t′,t)(t',t). In the case of executing line 40 at point tt, recall that pp calls cleanup(i)(i) from either Write(i,⋅)(i,\cdot) or CL(i)(i). If called from Write(i,⋅)(i,\cdot), pp previously calls line 15 and calls CL(i)(i) in that line, since the call occurs after the LL(i)(i) call which includes point t′t', and therefore d[i].tag=gd[i].\mathrm{tag} = g at method invocations. The CL(i)(i) call then decrements R[d[i].tag]=R[g]R[d[i].\mathrm{tag}] = R[g] in line 36 as g≠0g \ne0, which again contradicts that pp does not decrement R[g]R[g] throughout (t′,t)(t',t).

At point t†∈(t⋆,t)t^\dagger\in(t^\star,t), pp reads gg from L[i].tagL[i].\mathrm{tag} in line 3. Using Lemma 11 again, it follows that gg is locked for LiL_i at point t†t^\dagger. But since pp contributes one to R[g]R[g] throughout (t′,t)⊃[t⋆,t†](t',t) \supset[t^\star,t^\dagger], by Definition 10, gg is never unlocked for LjL_j in that interval. Thus, at point t†t^\dagger, gg is locked for both LiL_i and LjL_j, which contradicts (b) before point $t, and finishes the inductive case for (c).

To conclude the proof, we show that (a) holds at point tt, given that (b) and (c) hold at point tt. From Definition 5, the total contribution to a given element of RR increases or decreases exactly when that element is incremented (including via CAS(0,1)(0,1)) or decremented. (In particular, transfers of contribution between processes and objects do not change the total contribution to any element of RR.) Since Corollary 9 establishes that contributions are non-negative, to prove (a) it suffices to show that the total contribution to a given element of RR does not exceed n+1n + 1 at point tt, and thus that the element never overflows.

From Lemma 11 and (b), a given tag gg has a total contribution of at most one from all LL/SC objects at point tt. If at point tt, no process previously received a transferred contribution to gg in either line 20, 28, or 43 without having taken its next step of decrementing R[g]R[g], then by (c), each process contributes at most one to R[g]R[g]. Thus, in this case, the total contribution to R[g]R[g] is at most n+1n + 1, which would imply (a).

To finish proving (a), we will show that, at point tt, there can be at most one process to which tag gg was transferred without the subsequent decrement, and that if such a process exists, then no object contributes to R[g]R[g]. Suppose then that at point t′<tt' < t, some process pp executes either line 20, 28, or 43, gets transferred the nonzero tag gg from LiL_i, and does not execute its next line until after point tt. From Lemma 11, gg remains locked throughout [t′,t][t',t].

Suppose for the purpose of proving a contradiction that LjL_j (possibly Lj=LiL_j = L_i) contributes to R[g]R[g] at some point t†∈(t′,t)t^\dagger\in(t',t); by Lemma 8, L[j].tag=gL[j].\mathrm{tag} = g at this point. (If a second process is transferred tag gg at some point in that interval, then L[j].tag=gL[j].\mathrm{tag} = g for some object LjL_j immediately before the transfer, so that is also covered by this supposition.) Then there are points t1<t2<t†t_1 < t_2 < t^\dagger such that at point t1t_1, some process qq locks tag gg in line 19 or 27, and at point t2t_2, qq causes L[j].tagL[j].\mathrm{tag} to become gg in line 20, 28, or 30. Since gg is locked for LiL_i immediately before point t†t^\dagger, there is a point t⋆<t†t^\star< t^\dagger at which gg becomes locked for LiL_i by some process rr. Since, from the code for Write() and SC(), a process performs either a single Swap() on an object or at most one successful CAS() to set a tag field after locking a tag, it follows that t⋆≠t1t^\star\ne t_1. Whichever point is later between t⋆t^\star and t1t_1 contradicts (b), because gg becomes locked at the earlier of the two points, and remains locked until at least point tt which is later than both.

In summary, each process other than one process with a transferred tag contributes at most one to R[g]R[g], and there can be either one more contribution from an object, or one process with a transferred tag contributing two to R[g]R[g]. It follows that the total contribution to any element of RR is at most n+1n + 1 in all cases, thus obtaining (a) since the elements do not overflow. ◂

Corollary 13. While tag gg is locked by process pp for LiL_i, only pp can cause L[i].tagL[i].\mathrm{tag} to change to gg.

Proof. Suppose that L[i].tagL[i].\mathrm{tag} changes to gg at point tt by process qq, while gg is locked by process pp. Since (by Definition 10) only nonzero tags can be locked, the possible lines which can be executed at point tt are lines 20, 28, and 30. In each case, there is a point t′<tt' < t at which qq breaks out of a loop, in line 19 or 27. From Definition 10, qq locks tag gg at point t′t', and does not unlock gg until after point tt. From Lemma 12(b), q=pq = p, proving the corollary. ◀

Lemma 14. If at point tt some process executes line 20, or a successful CAS() in line 28 or 30, then L[i].tagL[i].\mathrm{tag} changes from some tag gg to a new tag g′∉{g,0}g' \notin\{g,0\} at point tt.

This lemma is analogous to Lemma 18 of [10], but its proof uses the new concept of locking tags.

Proof. Let pp be the process that executes line 20, or a successful CAS() in line 28 or 30 at point tt, and let g′g' be the value of L[i].tagL[i].\mathrm{tag} immediately after that point. Since pp chooses g′g' in line 18 or 26 from the set {1,…,4(k+1)n}\{1,\ldots,4(k+1)n\}, it follows that g′≠0g' \ne0, so it remains to show that L[i].tag≠g′L[i].\mathrm{tag} \ne g' immediately before tt.

Let t′<tt' < t be the point at which pp breaks out of its loop in line 19 or 27. Since R[g]=0R[g] = 0 immediately before t′t', it follows from Lemma 8 and Lemma 12(a) that L[i]≠gL[i] \ne g at t′t'. From Definition 10, g′g' is locked by pp at point t′t', and remains locked until it decrements its contribution to R[g]R[g], which by Definition 5 occurs immediately after point tt (transferring its contribution to L[i]L[i]). Since L[i].tag≠g′L[i].\mathrm{tag} \ne g' at point t′t', it follows from Corollary 13 that L[i].tag≠g′L[i].\mathrm{tag} \ne g' throughout [t′,t)[t',t), which concludes the proof. ◀

Protecting Tags

Definition 15 (Protected and Strongly Protected Tags). A tag gg becomes protected for LL/SC object LiL_i at point tt by a process pp if either

(a) pp reads zero from L[i].tagL[i].\mathrm{tag} in line 3 or 7 at point tt, in which case g=0g = 0, or

(b) pp reads gg from L[i].tagL[i].\mathrm{tag} in line 7 or 41 at point tt, such that its local variable pair (val,tag)(\mathrm{val},\mathrm{tag}) (read from L[i].tagL[i].\mathrm{tag} in line 3 or 38 respectively) equals the value of L[i]L[i] at point tt.

If a tag becomes protected for LiL_i during an LL(ii) call, then it is also strongly protected for LiL_i by pp. In that case, the protection and strong protection by process pp end when the calling process next invokes CL(ii). Otherwise, the tag becomes protected for LiL_i during a cleanup(ii) call, in which case it is not strongly protected by process pp, and the protection by pp ends when that call returns.

If a tag is protected or strongly protected by any process at point tt for LiL_i, we also simply refer to it as protected or strongly protected for LiL_i, without referring to the protecting process.

The only difference compared to Definition 9 of [10] is that protecting tags in the CL() method moves to the cleanup() helper method.

Lemma 16. If some tag is strongly protected for LiL_i at point tt, then C[i]≠0C[i] \ne0 at point tt.

This lemma corresponds to Lemma 10 of [10], and its proof is nearly identical.

Proof. From Definition 15, a tag can only become strongly protected for LiL_i by a process pp in an LL(ii) call in line 3 or 7, and both lines happen after pp increments C[i]C[i] in line 2 and before its next invocation of CL(ii). Since only CL(ii) can decrement C[i]C[i] (in line 37), it follows that pp’s strong protection of gg for LiL_i ends before it decrements C[i]C[i]. From Definition 5, pp contributes to C[i]C[i] throughout its strong protection of gg. The lemma then follows from Lemma 6(d) and Lemma 7.

Lemma 17. If a process pp has no pending method call on LiL_i at point tt, then pp strongly protects tag gg for LiL_i if and only if d[i].tag=gd[i].\mathrm{tag}=g for pp's dictionary dd at point tt.

This corresponds to Lemma 11 of [10], and the proof is essentially identical.

Proof. We first note that the only case in which pp can protect a tag for LiL_i while not having a pending method call on LiL_i, by Definition 15, is if it protected the tag as part of an LL(i)\mathrm{LL}(i) call. In particular, this implies that pp also strongly protects the tag. Moreover, only LL(i)\mathrm{LL}(i) can set d[i]d[i] to a non-⊥\bot value (in lines 4 and 11) and only CL(i)\mathrm{CL}(i) can reset d[i]d[i] to ⊥\bot (in line 36). An invocation of CL(i)\mathrm{CL}(i) ends pp's (strong) protection of any tag for LiL_i by Definition 15, and, from Lemma 3, d[i]=⊥d[i]=\bot when CL(i)\mathrm{CL}(i) responds. It therefore remains to show that an LL(i)\mathrm{LL}(i) call strongly protects tag gg for LiL_i by its response if and only if d[i].tag=gd[i].\mathrm{tag}=g at that call's response.

To show this, we consider the five possible response points from an LL(i)\mathrm{LL}(i) call by process pp. Suppose by induction that the lemma is true before the call begins (the base case holds since d[i]=⊥d[i]=\bot and processes protect no tags at t=0t=0). If pp protects some tag gg for LiL_i just before invocation of the LL(i)\mathrm{LL}(i) call, then d[i].tag=gd[i].\mathrm{tag}=g before invocation, and therefore pp invokes CL(i)\mathrm{CL}(i) in line 1. Thus, after line 1, pp does not protect any tag for LiL_i, and d[i]=⊥d[i]=\bot.

If pp responds in line 5 or 12, then pp reads zero from L[i].tagL[i].\mathrm{tag} in line 3 or 7 respectively. By Definition 15(a), pp strongly protects tag zero for LiL_i and sets d[i].tagd[i].\mathrm{tag} to zero in line 4 or 11 respectively before it responds.

If pp responds in line 8, then pp re-reads its local variables (val,tag)(\mathit{val},\mathit{tag}) from L[i]L[i] in line 7 after having set d[i]d[i] to (val,tag)(\mathit{val},\mathit{tag}) in line 4 and not changing it afterwards. By Definition 15(b), pp strongly protects d[i].tagd[i].\mathrm{tag} in line 7, at which point L[i]=d[i]L[i]=d[i].

Otherwise, pp responds in line 14, in which case the CL(i)\mathrm{CL}(i) call invoked in line 13 resets d[i]d[i] to ⊥\bot and ends any protection of a tag by pp for LiL_i.

Lemma 18. Suppose that a successful CAS()\mathrm{CAS}() takes place on L[i]L[i] at point tt, such that L[i].tag≠0L[i].\mathrm{tag}\ne0 immediately after tt. At point tt, some process pp executes line 28 or 30 of an SC(i,⋅)\mathrm{SC}(i,\cdot) call. Process pp strongly protects some tag g∗g^* for LiL_i from the invocation of its call until at least point tt.

This is a slightly simpler version of Lemma 12 from [10]. Note that the lemma phrasing supposes that a CAS()\mathrm{CAS}() operation specifically takes place at point tt, which rules out that a Swap()\mathrm{Swap}() in line 20 takes place instead.

Proof. Since only lines 28 and 30 are CAS()\mathrm{CAS}() operations which can change L[i].tagL[i].\mathrm{tag} to a nonzero value, it follows that point tt is the point that some process pp executes one of the two lines. Since pp does not return in line 23, by Lemma 17, pp strongly protects g∗=d[i].tagg^*=d[i].\mathrm{tag} for LiL_i when it invokes SC(i,⋅)\mathrm{SC}(i,\cdot). Moreover, since pp does not invoke CL(i)\mathrm{CL}(i) in between invoking SC(i,⋅)\mathrm{SC}(i,\cdot) and its successful CAS()\mathrm{CAS}() at point tt, by Definition 15 g∗g^* remains strongly protected for LiL_i until at least point tt.

History Independence

Having established the useful properties of our implementation, we can now prove our results, starting with the QHI-preserving property. This result, proven in Theorem 21, is the same statement as Theorem 15 of [10], but with more work needed to prove it.

Lemma 19. If no process has a pending method call on LiL_i and no process strongly protects a tag for LiL_i at point tt, then C[i]=0C[i] = 0 at point tt. If no process has a pending method call on any object and no process strongly protects any tag at point tt, then R[g]=0R[g] = 0 for all g∈{1,…,4(k+1)n}g \in\{1,\ldots,4(k+1)n\}.

Proof. Suppose that no process has a pending method call on LiL_i and no process strongly protects any tag for LiL_i at point tt. If d[i]≠⊥d[i] \ne\perp for some process, then d[i].tag=gd[i].\mathrm{tag} = g for some tag g∈{0,…,4(k+1)n}g \in\{0,\ldots,4(k+1)n\}. From Lemma 17, pp would strongly protect gg at point tt; thus, d[i]=⊥d[i] = \perp for all processes at point tt. Lemma 6(a) and Lemma 7 then imply that C[i]=0C[i] = 0 at point tt. If no process has any pending method call or strongly protects any tag at point tt, then Lemma 6(b) and Lemma 12(a) imply that R[g]=0R[g] = 0 for all gg.

Lemma 20. If at point tt no process has a pending method call on LiL_i, except possibly a pending next step of line 44 or 45, and no process strongly protects a tag for LiL_i, then L[i].tag=0L[i].\mathrm{tag} = 0 at point tt.

This lemma corresponds to Lemma 14 of [10], but with more cases to consider.

Proof. The lemma is true for t=0t = 0, since L[i].tagL[i].\mathrm{tag} is initialized to zero for each i∈{1,…,m}i \in\{1,\ldots,m\}. The Read⁡(i)\operatorname{Read}(i) method cannot be pending and does not affect which tags the calling process protects or the value of L[i].tagL[i].\mathrm{tag}, so we need not consider it for this lemma. Similarly, by Lemma 17, we have that method calls which respond in either line 23, 34, or 47 do not affect which tags the calling process strongly protects or the value of L[i].tagL[i].\mathrm{tag}. Method calls on objects Lj≠LiL_j \ne L_i also do not affect whether the calling process strongly protects a tag for LiL_i of the value of L[i].tagL[i].\mathrm{tag}. Note that all the method calls mentioned so far are either not for LiL_i, or consist of at most one shared memory step before returning. Therefore, none of them change whether a process has a pending method call on LiL_i. We can therefore assume without loss of generality that point tt is either the response point of a method not covered by this paragraph, or (immediately after) an execution of line 43.

By inspection of the code and by Definition 15 and Lemma 17, the remaining method calls for which the calling process responds without strongly protecting a tag for LiL_i at the response point are exactly

(a) an LL⁡(i)\operatorname{LL}(i) call that responds in line 14,

(b) an SC⁡(i,⋅)\operatorname{SC}(i,\cdot) call that responds in line 33,

(c) a CL⁡(i)\operatorname{CL}(i) call that responds after line 34,

(d) a VL⁡(i)\operatorname{VL}(i) call that responds in line 50, and

(e) a Write⁡(i,⋅)\operatorname{Write}(i,\cdot) call.

The cases of responding in either line 14, 33, or 50 all immediately follow a CL⁡(i)\operatorname{CL}(i) call. As such, we can further assume that point tt is either the response point or an execution of line 43 from a CL⁡(i)\operatorname{CL}(i) or a Write⁡(i,⋅)\operatorname{Write}(i,\cdot) call cc.

By Lemma 19, C[i]=0C[i] = 0 at point tt if it is a response point. Since lines 44 and 45 do not affect C[i]C[i], and in all cases there are no shared memory operations after line 45 until the calling process becomes idle, it also follows that C[i]=0C[i] = 0 if tt is an execution of line 43. Since call cc does not respond in line 34, either it decrements C[i]C[i] in line 37, or it is a Write⁡()\operatorname{Write}() call. Therefore, there is a point before tt at which either C[i]C[i] is decremented to zero, or line 20 of a Write⁡(i,⋅)\operatorname{Write}(i,\cdot) call takes place. (Note from the code that neither can take place at point tt itself.) Let t′t' be the last such point before point tt. Since only line 37 decrements C[i]C[i], it follows that either some CL⁡(i)\operatorname{CL}(i) call c′c' (possibly c′=cc' = c) decrements C[i]C[i] to zero at point t′t', or a Write⁡(i,⋅)\operatorname{Write}(i,\cdot) call c′c' executes line 20 at point t′t'. Let pp be the process executing call c′c'. By definition of t′t', we also have that no Write(i, ·) call executes line 20 in the interval (t′,t](t', t], and C[i]=0C[i] = 0 throughout the interval. If c′c' is a CL(i) call, then pp sees a 1 from the FAD() in line 37, and then invokes cleanup(i). Otherwise, c′c' is a Write(i, ·) call, and so it reads C[i]=0C[i] = 0 when it executes line 22 in (t′,t](t', t], and therefore also invokes cleanup(i). Since no process has a pending method call on LiL_i at point tt other than possibly lines 44 or 45, pp’s call has executed line 43 or responded by point tt.

Since C[i]=0C[i] = 0 throughout the interval (t′,t](t', t], by Lemma 16, we have that no tag is strongly protected for LiL_i throughout (t′,t](t', t]. Therefore, from Lemma 18, no successful CAS() takes place on L[i]L[i] in (t′,t](t', t] that sets L[i].tagL[i].\mathrm{tag} to a nonzero value. Since the only other line which can change L[i].tagL[i].\mathrm{tag} to a nonzero value is line 20, and this line is not executed in (t′,t](t', t], it follows that L[i].tagL[i].\mathrm{tag} does not change to a nonzero value in that interval. In particular, if L[i].tagL[i].\mathrm{tag} changes at all in the interval, it only does so from a successful CAS() in line 43, which changes L[i].tagL[i].\mathrm{tag} to zero without changing L[i].valL[i].\mathrm{val}. It thus suffices to show that L[i].tag=0L[i].\mathrm{tag} = 0 at some point during pp’s cleanup(i) call.

If pp responds from its cleanup(i) call in line 39, or if the if-condition in line 41 is False, then L[i].tagL[i].\mathrm{tag} changes at some point in (t′,t](t', t], and therefore L[i].tagL[i].\mathrm{tag} changes to zero at that point, proving the lemma. Otherwise, we have that pp reads zero from C[i]C[i] in line 42, and therefore executes the CAS() in line 43. If the CAS() succeeds, then L[i].tag=0L[i].\mathrm{tag} = 0 immediately after it, and therefore by point tt, proving the lemma. Otherwise, L[i]L[i] changes at some point after t′t' and before the CAS() attempt, and so we again have that L[i].tag=0L[i].\mathrm{tag} = 0 at that point. ◀

Our first main theorem establishes that in a settled state (defined in § 1), all shared memory apart from LL/SC values stored in val fields are set to their default values of zero, implying that our implementation preserves quiescent history independence.

Theorem 21. If every process is idle and has no outstanding LL() operation on any LL/SC object at point tt, then all values of CC, RR, and all tag fields of LL are zero at point tt.

This theorem corresponds to Theorem 15 of [10].

Proof. From Lemma 4, all values of dd are ⊥\perp for every process at point tt. From Lemma 17, no process strongly protects any tag at point tt. The theorem then follows from Lemmas 19 and 20. ◀

Expected Step Complexity

The core idea to prove expected step complexity is the same as in [10], but the main additional difficulty compared to that paper is in keeping track of contributions in § 4.1 and Lemma 22.

Lemma 22. At all points in the execution, the total contribution to all elements of RR is at most 2(k+1)n2(k+1)n.

Proof. From Lemma 6(e), each process contributes at most k+2k+2 in total to the elements of RR at any given time.

From Lemmas 8 and 20, for each LL/SC object LiL_i which contributes one to some element of RR, there exists a process that either

  • has a pending method call on LiL_i, other than a pending next step of line 44 or 45, or

  • strongly protects some tag for LiL_i.

In the case of a process without a pending method call on LiL_i which strongly protects some tag for LiL_i, by Lemma 17 d[i]≠⊥d[i] \ne\perp for that process, and by Lemma 4 the process has an outstanding LL(i). As required in 2.4, each process has at most kk outstanding LL() operations on objects for which it does not have a pending method call. Thus, each process can be associated with at most k+1k+1 contributions to RR from LL/SC objects.

However, from Lemma 4, Definition 5, Lemma 6(b), and inspection of the code, the only situation in which a process can contribute exactly k+2k+2 to the elements of RR is if

  • the process has kk outstanding LL(i) operations, and

  • its last step was a successful CAS() in line 43, making its pending next step of line 44.

This scenario is mutually exclusive with that of an LL/SC object ii contributing to an element of RR due to that same process having a pending method call on LiL_i, since it cannot have line 44 as its pending next step. As such, each process can be associated with at most k+2+k+1−1=2k+2k+2+k+1-1=2k+2 total contributions to RR. Thus, the total contribution to RR is at most 2(k+1)n2(k+1)n.

Theorem 23 (Expected Step Complexity). Each method other than Write() and SC() has a constant bound on its number of steps. The expected step complexity of the Write() and SC() methods is constant under a weak adaptive adversary.

This theorem corresponds to Theorem 7 of [10].

Proof. The first part is immediate from the fact that the only loops in the implementation are lines 17 to 19 of the Write() method and lines 25 to 27 of the SC() method.

For the second part, recall that under the weak adaptive adversary, a random choice by process pp is immediately followed by its next shared memory step. Thus, when pp chooses a random tag gg in line 18 or 26, it then immediately attempts a CAS() on R[g]R[g] in line 19 or 27, respectively, without any other process taking a step in between the two respective lines. In particular, the value of R[g]R[g] does not change in between the two lines. Therefore, pp’s CAS() on R[g]R[g] from zero to one in line 19 or 27 succeeds if and only if R[g]=0R[g]=0 when pp executes line 18 or 26, respectively. Thus, pp breaks out of its loop as soon as it chooses a tag gg such that R[g]=0R[g]=0 when pp executes line 18 or 26, in which case it sets R[g]R[g] to one upon exiting the loop. Since this random choice is uniform over {1,…,4(k+1)n}\{1,\ldots,4(k+1)n\} and independent, it suffices to show that, at any given time, at least a constant fraction of the indices in RR have a value of zero.

From Lemma 22, the total contribution to all elements of RR is at most 2(k+1)n2(k+1)n, and from Corollary 9, all contributions are non-negative. Thus, at any given time, at least 2(k+1)n2(k+1)n of RR’s 4(k+1)n4(k+1)n elements have zero contribution and hence, by Lemma 12(a), a value of zero, which completes the proof.

Linearizability

We conclude the analysis by proving in Theorem 29 that the algorithm is a linearizable implementation of the sequential specification from Section 2.3. There are more cases to consider compared to [10] due to the interaction between the Write() and SC() methods, but the new concept of locked tags makes some arguments a little simpler.

Lemma 24. If tag g≠0g \ne0 is protected for some object at point tt, then R[g]≠0R[g] \ne0 at point tt.

This corresponds to Lemma 16 of [10], with a slightly modified proof.

Proof. Suppose that process pp protects tag g≠0g \ne0 for some LL/SC object LiL_i at point t⋆t^{\star}. Observe from Definition 15(b) that when a nonzero tag gg is protected in line 7 or 41, the process pp protecting it has incremented R[g]R[g] (in line 6 or 40 respectively) and not yet decremented R[g]R[g]. From Definition 5, pp therefore contributes a nonzero value to R[g]R[g] at point t⋆t^{\star}.

In the case of line 7, by Definition 15(b), L[i]L[i] matches pp’s variable pair (val,tag)(val, tag) at point t⋆t^{\star} (so L[i].tag=tag=gL[i].tag = tag = g); therefore, pp returns in line 8. If pp decrements its contribution by transferring it to an LL/SC object in either line 20, 28, or 30, then that decrement cancels out an increment in either line 19 or 27 of the same method call. Also, if pp decrements its contribution in either line 21, 29, or 44, then a contribution from an LL/SC object would have been previously transferred to pp in either line 20, 28, or 43. Thus, pp’s contribution to R[g]R[g] does not decrement to zero until at least the next point after t⋆t^{\star} at which it decrements the value of R[g]R[g] within a CL(i)(i) call, in which case gg ceases to be protected for LiL_i at that call’s invocation, or in line 10 of a subsequent invocation of LL(i)(i). However, since only CL(i)(i) can reset d[i]d[i] to ⊥\perp (in line 36), if pp invokes LL(i)(i) after point t⋆t^{\star} without invoking CL(i)(i) in between, then it invokes CL(i)(i) in line 1. This makes gg no longer protected for LiL_i before pp decrements R[g]R[g] in line 10.

In the case of line 41, pp decrements R[g]R[g] in line 45, and possibly also in line 44. As mentioned earlier, if pp decrements R[g]R[g] in line 44, then it also increments its contribution to R[g]R[g] via a transfer from LiL_i in line 43. Hence, pp’s contribution can only decrement to zero in line 45, at which point pp’s protection of gg ends.

Therefore, pp does not decrement its contribution to R[g]R[g] after point t⋆t^{\star} until after gg is no longer protected for LiL_i. The lemma then follows from Lemma 6(e) and Lemma 12(a). ◀

Lemma 25 (Protection Invariant). Suppose that tag gg is protected for LiL_i at point tt.

(a) L[i].tagL[i].tag does not change from a value different from gg to gg at point tt, and

(b) if gg is strongly protected for LiL_i at point tt, then L[i].tagL[i].tag also does not change from a value different from gg to zero at point tt.

This lemma corresponds to Lemma 17 of [10], but the proof of (a) uses a different technique, using the new concept of locked tags.

Proof. We prove this lemma by contradiction. Suppose that the invariant is not true, and let tt be the first point in an execution at which it fails. Thus, at point tt, there exists a tag gg that is protected for LiL_i, and L[i].tagL[i].tag changes from a tag g′≠gg' \ne g to gg, or to zero if gg is strongly protected for LiL_i.

Suppose first that (b) fails at point tt, and therefore that gg is strongly protected for LiL_i at point tt, but that L[i].tagL[i].tag changes from some tag g′≠gg' \ne g to zero at that point. Only line 43 can change L[i].tagL[i].tag to zero, since the only other lines which can change L[i].tagL[i].tag, namely lines 20, 28, and 30, choose a tag that is nonzero (from lines 18 and 26). Thus, there is a process pp which executes a successful CAS() in line 43 at point tt, changing L[i].tagL[i].tag from g′g' (pp’s local value of tagtag) to zero. The if conditions that pp checks in lines 41 and 42 immediately before its CAS() at point tt both return true, since pp executes line 43. Therefore, there exist points tL<tC<tt_L < t_C < t, such that L[i].tag=g′L[i].tag = g' at point tLt_L, and C[i]=0C[i] = 0 at point tCt_C.

From Definition 15(b), g′g' becomes protected for LiL_i at point tLt_L, and it remains protected until pp executes line 45, which is after point tt. From Lemma 16, gg is not strongly protected for LiL_i at point tCt_C. Since by assumption gg is strongly protected for LiL_i at point t>tCt > t_C, gg becomes strongly protected for LiL_i at some point t⋆∈(tC,t)t^{\star} \in(t_C,t). By Definition 15, L[i].tag=gL[i].tag = g at point t⋆t^{\star}. Since L[i].tag=g′≠gL[i].tag = g' \ne g just before point t>t⋆t > t^{\star}, there is a point t′∈(t⋆,t)t^{\prime} \in(t^{\star},t) at which L[i].tagL[i].tag changes from some value different from g′g' (possibly gg) to g′g'. But since g′g' is protected for LiL_i throughout (tL,t](t_L,t] (recall that tL<tC<t⋆<t†<tt_L < t_C < t^\star< t^\dagger< t), point t†t^\dagger violates (a), contradicting that tt is the first point at which the invariant fails.

It remains to derive a contradiction for the case where (a) fails at point tt, and therefore that L[i].tagL[i].\mathrm{tag} changes from some tag g′≠gg' \ne g to gg at point tt, while gg is protected for LiL_i. Note that if g=0g = 0, then it cannot become protected in line 41, as the cleanup() method would exit in line 39. Thus, if g=0g = 0 is protected then it is protected during an LL() call, and therefore it is also strongly protected, so the contradiction follows from that just derived for (b). We can therefore assume without loss of generality that g≠0g \ne0.

Since the only lines that can change L[i].tagL[i].\mathrm{tag} to a nonzero value are lines 20, 28, and 30, there is a point t′<tt' < t at which pp increments R[g]R[g] from zero to one, in line 19 or 27. By Definition 10, gg is locked by pp throughout the interval (t′,t](t',t]. Since R[g]=0R[g] = 0 immediately before point t′t', by Lemma 24 we have that gg is not yet protected immediately before t′t'. Since, by Definition 15, lines 19 and 27 do not cause a tag to become protected, gg is also not protected at point t′t', and so gg becomes protected at some point t⋆∈(t′,t)t^\star\in(t',t). By Definition 15, L[i].tag=gL[i].\mathrm{tag} = g at point t⋆t^\star. Since R[g]=0R[g] = 0 immediately before t′t', by Lemma 8 and Lemma 12(a) we also have that L[i].tag≠gL[i].\mathrm{tag} \ne g at point t′t' (recall that L[i]L[i] does not change at point t′t'). Therefore, there is a point t†∈(t′,t⋆)t^\dagger\in(t',t^\star) at which L[i].tagL[i].\mathrm{tag} changes from some value different from gg to gg. The process taking the step at point t†t^\dagger is not pp, since pp does not change the value of L[i]L[i] in between points t′t' and tt. Since gg is locked by pp at point t†∈(t′,t]t^\dagger\in(t',t], this violates Corollary 13, which is a contradiction.

Definition 26 (Function lin⁡\operatorname{lin}). We define a function lin⁡(c)\operatorname{lin}(c) from method calls cc in an execution to points in time, and later (in Theorem 29) prove that they are correct linearization points for the implementation.

If cc is an LL() call, then lin⁡(c)\operatorname{lin}(c) depends on which line the method responds from. If it responds in line 5 or 14, then lin⁡(c)\operatorname{lin}(c) occurs at line 3. If it responds in line 8 or 12, then lin⁡(c)\operatorname{lin}(c) occurs at line 7.

If cc is a Read() call, then lin⁡(c)\operatorname{lin}(c) occurs at line 46 (its only step).

If cc is a VL() call, then lin⁡(c)\operatorname{lin}(c) occurs at its invocation if it returns in line 47, and otherwise lin⁡(c)\operatorname{lin}(c) occurs at line 48.

If cc is a Write() call, then lin⁡(c)\operatorname{lin}(c) occurs at line 20.

If cc is an SC() call, then lin⁡(c)\operatorname{lin}(c) occurs at its invocation if it returns in line 23, and otherwise lin⁡(c)\operatorname{lin}(c) is the point of the last CAS() operation on LL. That is, if the CAS() in line 28 succeeds, then lin⁡(c)\operatorname{lin}(c) occurs at line 28, and otherwise lin⁡(c)\operatorname{lin}(c) occurs at line 30.

If cc is a CL() call, then lin⁡(c)\operatorname{lin}(c) occurs at its invocation.

For an execution with pending method calls, lin⁡(c)\operatorname{lin}(c) is undefined for pending LL() calls, and for other method calls for which the line corresponding to lin⁡(c)\operatorname{lin}(c) has not yet been executed.

The only new addition relative to Definition 19 from [10] is the Write() method, for which lin⁡(c)\operatorname{lin}(c) maps to the intuitive point of line 20.

Lemma 27. Suppose that cc is either an SC(i,u) or VL(i) call by process pp. The call returns True, and changes L[i].valL[i].\mathrm{val} to uu at point lin⁡(c)\operatorname{lin}(c), in the case of SC(i,u), if and only if

(a) some tag becomes strongly protected for LiL_i by pp at some point t<lin⁡(c)t < \operatorname{lin}(c), and remains strongly protected by pp throughout (t,lin⁡(c)](t,\operatorname{lin}(c)],

(b) no Write(i,·) call executes the Swap() operation in line 20 in the interval (t,lin⁡(c))(t,\operatorname{lin}(c)),

(c) no SC(i,·) call has a successful CAS() in line 28 or 30 in the interval (t,lin⁡(c))(t,\operatorname{lin}(c)),

This lemma corresponds to Lemma 20 of [10], but here we have the new condition (b). The proof is mostly unchanged from that of [10].

Proof. We first prove the forward direction, so we first assume that cc returns True. Since cc returns True, it responds in either line 48 or 33. Since in particular it does not return in line 47 or 23, it means that d[i]≠⊥d[i] \ne\perp when pp invokes cc. By Lemma 17, d[i].tagd[i].\mathrm{tag} is strongly protected at cc’s invocation, starting from some previous point t<lin⁡(c)t < \operatorname{lin}(c), and by Definition 15 it remains protected until after lin⁡(c)\operatorname{lin}(c). Thus, (a) is satisfied for some point t<lin⁡(c)t < \operatorname{lin}(c).

Let g⋆g^\star be the tag that pp strongly protects at point tt, i.e., its value of d[i].tagd[i].\mathrm{tag} in call cc. Suppose for the purpose of proving a contradiction that either (b) or (c) is false, so either line 20 or a successful CAS() in either line 28 or 30 takes place in (t,lin⁡(c))(t,\operatorname{lin}(c)), and let t′t' be the first such point. Note that the only other operation which can change the value of L[i]L[i] happens in line 43, which also sets L[i].tagL[i].\mathrm{tag} to zero. Since, by Definition 15, L[i].tag=g⋆L[i].\mathrm{tag} = g^\star at point tt, it follows that L[i].tagL[i].\mathrm{tag} is either g⋆g^\star or zero immediately before point t′t'. By Lemma 14, L[i].tagL[i].\mathrm{tag} changes to a different and nonzero value at point t′t', and by Lemma 25, L[i].tagL[i].\mathrm{tag} does not change to g⋆g^\star at point t′t' since g⋆g^\star is protected at that point. Thus, L[i].tagL[i].\mathrm{tag} changes to some nonzero tag distinct from g⋆g^\star at point t′t'. Applying Lemma 25 to each change to L[i].tagL[i].\mathrm{tag} in (t′,lin⁡(c))(t',\operatorname{lin}(c)) (if any), we obtain that L[i].tagL[i].\mathrm{tag} can only change to other nonzero values distinct from g⋆g^\star throughout the interval. But, since we assume that cc returns True, and lin⁡(c)\operatorname{lin}(c) occurs at either line 28, 30, or 48, it follows from the code that L[i].tag∈{g⋆,0}L[i].\mathrm{tag} \in\{g^\star,0\} immediately before lin⁡(c)\operatorname{lin}(c), which is a contradiction. Thus, (c) and (b) follow, finishing the proof for the forward direction.

It remains to show the reverse direction, so we assume that (a), (c), and (b) each hold for cc. Like the forward case, let g⋆g^\star be the tag that pp strongly protects throughout (t,lin⁡(c)](t,\operatorname{lin}(c)], and we obtain from Definition 15 that L[i].tag=g⋆L[i].\mathrm{tag} = g^\star at point tt. From Lemma 17, pp’s value of d[i].tagd[i].\mathrm{tag} is g⋆g^\star at cc’s invocation, and in particular pp does not return in line 47 or 23. Since no step which can change L[i].tagL[i].\mathrm{tag} to a nonzero value (i.e., line 20 or a successful CAS() in either line 28 or 30) takes place throughout (t,lin⁡(c))(t,\operatorname{lin}(c)), it follows that L[i].tag∈{g⋆,0}L[i].\mathrm{tag} \in\{g^\star,0\} immediately before point lin⁡(c)\operatorname{lin}(c). If cc is a VL(i) call, then the call returns True because g⋆g^\star is pp’s value of d[i].tagd[i].\mathrm{tag}. If cc is an SC(i, ·) call and its CAS() in line 28 succeeds, then the call returns True. Otherwise, the CAS() in line 28 fails, so pp performs a second CAS() in line 30, and lin⁡(c)\operatorname{lin}(c) is the point of that second CAS(). Since the only possible transition of L[i].tagL[i].\mathrm{tag}’s value in (t,lin⁡(c))(t,\operatorname{lin}(c)) is from g⋆g^\star to zero, it follows that L[i].tag=0L[i].\mathrm{tag} = 0 when pp executes line 28, and therefore remains at zero immediately before lin⁡(c)\operatorname{lin}(c), making the second CAS() successful.

Lemma 28. Suppose that cc is an LL(i) call by process pp, such that lin⁡(c)=t\operatorname{lin}(c) = t and that the call responds at point t′t'. If some tag becomes strongly protected for LiL_i by pp during the call, then it becomes strongly protected at point tt. Otherwise, some process q≠pq \ne p executes a call c′c' which is either a Write(i, ·) call or an SC(i, ·) call with a successful CAS() at point lin⁡(c′)\operatorname{lin}(c'), such that t<lin⁡(c′)<t′t < \operatorname{lin}(c') < t'.

This corresponds to Lemma 21 of [10] with the only difference that an overlapping Write() operation can also cause an LL() call to not strongly protect a tag.

Proof. Combining Definitions 15 and 26, an LL() call cc that responds in line 5, 8, or 12 causes a tag to become strongly protected at lin⁡(c)\operatorname{lin}(c), and an LL() call that responds in line 14 does not strongly protect any tag, proving the first claim. If cc responds in line 14, then pp’s local variable tag≠0\mathrm{tag} \ne0 and tag′∉{tag,0}\mathrm{tag}' \notin\{\mathrm{tag}, 0\}. In particular, at point t†∈(t,t′)t^\dagger\in(t,t'), pp executes line 7, in which it reads tag′\mathrm{tag}' from L[i].tagL[i].\mathrm{tag}. Thus, there is some point t‡∈(t,t′)t^\ddagger\in(t,t') at which L[i].tagL[i].\mathrm{tag} first changes to a value not in {tag,0}\{\mathrm{tag},0\}. The only lines that can change L[i].tagL[i].\mathrm{tag} to a nonzero value are a Swap() in line 20 or a successful CAS() in line 28 or 30, and by Definition 26 this operation is the linearization point of a Write(i, ·) or SC(i, ·) call. Hence, t‡=lin⁡(c′)t^\ddagger= \operatorname{lin}(c') for some Write(i, ·) call or SC(i, ·) call with a successful CAS() on L[i]L[i]. Moreover, since c′c' and cc overlap, it follows that c′c'’s calling process q≠pq \ne p.

Theorem 29 (Linearizability). The LL/SC implementation is linearizable according to the sequential specification, with lin⁡(c)\operatorname{lin}(c) as the linearization point for each call cc.

This corresponds to Theorem 22 of [10], and the proof is mostly unchanged.

Proof. Consider an execution of writable LL/SC objects using this implementation. For each pending call cc in the execution such that lin⁡(c)\operatorname{lin}(c) is undefined according to Definition 26, we remove cc from the linearization. For each CL() call invoked internally from an LL(), SC() or VL() call, we also remove it from the linearization. We construct the linearization from the remaining calls, sorting them by lin⁡(c)\operatorname{lin}(c). (Recall that cleanup() is a helper method, and so is not directly called in an execution. As such, it is not part of the linearization.)

We prove that this linearization is correct, by induction over calls cc sorted by lin⁡(c)\operatorname{lin}(c). Specifically, we prove that each call cc returns a valid response and correctly affects the interpreted abstract state of the system. We inductively show that the interpreted value of LL/SC object LiL_i is L[i].val⁡L[i].\operatorname{val} before and after each linearization point. This is true initially since L[i].val⁡L[i].\operatorname{val} is initialized to uiu_i, the application-dependent initial value for LiL_i. Recall from the sequential specification (§ 2.3) that the context bit ℓp\ell_p of LiL_i equals 1 (i.e., pp has an open link to LiL_i) immediately before a given method call cc of a sequential execution if and only if

  • an LL(i) operation c′c' is called by process pp before call cc in the sequential execution,

  • no Write(i, ·) or successful SC(i, ·) call (i.e., a call returning True) by any process takes place in between c′c' and cc, and

  • no CL(i) call by pp takes place in between c′c' and $c.

It also follows from the sequential specification that the context bit only directly affects the return value of SC(i, ·) and VL(i) calls. As such, to prove correct behaviour of context bits, it suffices to show that SC(i, ·) and VL(i) calls return True if and only if the relevant context bit should be 1 immediately before the respective call in the linearization.

If cc is a Read(i) or LL(i) call, then its correctness follows from the fact that the call returns L[i].val⁡L[i].\operatorname{val} at lin⁡(c)\operatorname{lin}(c).

If cc is a Write(i, u) call, then its correctness follows from the fact that L[i].val⁡=uL[i].\operatorname{val} = u immediately after lin⁡(c)\operatorname{lin}(c), since lin⁡(c)\operatorname{lin}(c) takes place at the call’s execution of Write, which unconditionally writes uu into L[i].val⁡L[i].\operatorname{val}. If an SC(i, u) call cc returns True, then L[i].val⁡=uL[i].\operatorname{val} = u immediately after lin⁡(c)\operatorname{lin}(c), since by Definition 26 cc has a successful CAS() changing L[i].val⁡L[i].\operatorname{val} to uu at point lin⁡(c)\operatorname{lin}(c). From the code and Definition 26, L[i].val⁡L[i].\operatorname{val} changes at point t′t' only if there is a call c′c' with lin⁡(c′)=t′\operatorname{lin}(c') = t', such that c′c' is either a Write(i, u) call, or an SC(i, u) call which returns True. In both cases, L[i].val⁡L[i].\operatorname{val} changes to uu at point t′t'. Therefore, if cc is an SC(i, u) or VL(i) call by process pp, we only need to show that it returns True if and only if the interpreted context bit ℓp=1\ell_p = 1, based on the three conditions listed earlier.

Suppose that an SC(i, u) or VL(i) call cc by process pp does return True, and we will show that ℓp=1\ell_p = 1 before cc according to the three conditions. By Lemma 27(a), there is a point t<lin⁡(c)t < \operatorname{lin}(c) at which some tag gg becomes strongly protected for LiL_i by cc’s calling process pp, and it remains strongly protected until at least lin⁡(c)\operatorname{lin}(c). By Definition 15, only an LL(i) call c′c' by pp can cause pp to strongly protect gg, and by Lemma 28, gg becomes strongly protected at point lin⁡(c′)\operatorname{lin}(c').

Since a CL(i) call by pp ends its strong protection of any tag for LiL_i, and gg remains strongly protected from lin⁡(c′)\operatorname{lin}(c') until at least lin⁡(c)\operatorname{lin}(c), it follows that pp does not call CL(i) in between c′c' and cc. By Lemma 27(c) and (b), no SC(i, ·) call has a successful CAS() on L[i]L[i] in the interval (lin(c′),lin(c))(lin(c'), lin(c)), and no execution of line 20 takes place in that interval. Since an SC(i, ·) call ss with a successful CAS() operation returns True and has lin(s)lin(s) at the point of that CAS(), it follows that there is no such call ss with lin(c′)<lin(s)<lin(c)lin(c') < lin(s) < lin(c). Similarly, since a Write(i, ·) call ww has lin(w)lin(w) at its execution of line 20, there is no such call ww with lin(c′)<lin(w)<lin(c)lin(c') < lin(w) < lin(c). Therefore, the three conditions are satisfied and the interpreted context bit ℓp=1\ell_p = 1 immediately before lin(c)lin(c), as required.

Now suppose that the interpreted context bit ℓp=1\ell_p = 1 immediately before call lin(c)lin(c) for an SC(i, uu) or VL(i) call cc by process pp. Then, by the three conditions, pp has an LL(i) call c′c' with lin(c′)<lin(c)lin(c') < lin(c), such that pp does not directly call CL(i) in between c′c' and cc. There is also no successful CAS() from an SC(i, ·) call ss in line 28 or 30 such that lin(c′)<lin(s)<lin(c)lin(c') < lin(s) < lin(c), and no Swap() from a Write(i, ·) call ww in line 20 such that lin(c′)<lin(w)<lin(c)lin(c') < lin(w) < lin(c).

Suppose without loss of generality that c′c' is the last LL(i) call by pp before cc (if the three conditions hold for an earlier LL(i) call, then they also hold for c′c'). From Lemma 28, some tag gg becomes strongly protected by pp at point lin(c′)lin(c') (since pp responds from c′c' before it invokes cc). In order to use Lemma 27, we need to show that this strong protection lasts until at least lin(c)lin(c), and in particular that pp does not indirectly call CL(i) in between lin(c′)lin(c') and lin(c)lin(c). (Recall that indirect calls of CL() are removed from the linearization). The possible indirect calls of CL(i) are in lines 1, 13, 32, and 49, so we will show that pp does not execute any of these lines in between lin(c′)lin(c') and lin(c)lin(c) by deriving contradictions for each case.

For line 1, since the line occurs before any possible line mapped to by linlin for LL(), it would have to be part of an LL(i) call after c′c', which contradicts that c′c' is the last LL(i) call by pp before cc. For line 13, by the above arguments it should be part of call c′c', but by Definition 15 and inspection of the code, no tag becomes strongly protected during c′c', which contradicts that some tag does become strongly protected at point lin(c′)lin(c'). Line 32 would be part of an SC(i, ·) call, so we will show that pp does not make any such call in between c′c' and cc. If such a call were to return True, this contradicts the assumption there is no SC(i, ·) call which returns True in the linearization in between calls c′c' and cc. If such a call were to return False, then by the inductive hypothesis there is another SC(i, ·) call ss which returns True with lin(c′)<lin(s)<lin(c)lin(c') < lin(s) < lin(c), and this also contradicts our assumption. This last argument also applies if pp executes line 49 in between lin(c′)lin(c') and lin(c)lin(c), since that line is only executed in a VL(i) call which returns False.

We therefore have that a tag becomes strongly protected by pp for LiL_i at point lin(c′)lin(c') and remains so until at least point lin(c)lin(c). Since no successful CAS() from an SC(i, ·) call and no Swap() from a Write(i, ·) call takes place in between lin(c′)lin(c') and lin(c)lin(c), from Lemma 27, cc does return True.

Since CL() only affects ℓp\ell_p, which itself only becomes visible via SC() and VL() calls which we have already covered, the proof is complete.

Theorems 21, 23, and 29 together imply Theorem 1.

Conclusion

We have shown how to support an unconditional and randomized wait-free Write() operation to a QHI-preserving LL/SC implementation [10], using base objects that support swap, compare-and-swap, and fetch-and-increment/decrement, with the same asymptotic space and expected complexity. The changes require significant modifications to the technical analysis in order to prove that the results still hold with this larger set of supported operations. Our result paves the way for designing more algorithms in the new field of history-independent concurrency. A natural open problem is to implement more primitive operations in software that preserve history independence.

References

  1. [1]Umut A. Acar, Guy E. Blelloch, Robert Harper, Jorge L. Vittes, and Shan Leung Maverick Woo. Dynamizing static algorithms, with applications to dynamic trees and history independence. In Proceedings of the 15th ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 531–540, 2004. URL: http://dl.acm.org/citation.cfm?id=982792.982871.
  2. [2]Zahra Aghazadeh, Wojciech Golab, and Philipp Woelfel. Making objects writable. In Proceedings of the 33rd ACM Symposium on Principles of Distributed Computing (PODC), PODC ’14, pages 385–395, 2014. doi:10.1145/2611462.2611483.
  3. [3]Zahra Aghazadeh and Philipp Woelfel. Upper bounds for boundless tagging with bounded objects. In Proceedings of the 30th International Symposium on Distributed Computing (DISC), pages 442–457, 2016. doi:10.1007/978-3-662-53426-7_32.
  4. [4]James H. Anderson and Mark Moir. Universal constructions for large objects. In Proceedings of the 9th International Workshop on Distributed Algorithms (WDAG), volume 972, pages 168–182, 1995. doi:10.1007/BFb0022146.DOI
  5. [5]James H. Anderson and Mark Moir. Universal constructions for multi-object operations. In Proceedings of the 14th ACM Symposium on Principles of Distributed Computing (PODC), pages 184–193, 1995. doi:10.1145/224964.224985.
  6. [6]Hagit Attiya, Michael A. Bender, Martín Farach-Colton, Rotem Oshman, and Noa Schiller. History-independent concurrent objects. In Proceedings of the 43rd ACM Symposium on Principles of Distributed Computing (PODC), pages 14–24, 2024. doi:10.1145/3662158.3662814.DOI
  7. [7]Hagit Attiya, Michael A. Bender, Martín Farach-Colton, Rotem Oshman, and Noa Schiller. History-independent concurrent hash tables. In Proceedings of the 57th Annual ACM Symposium on Theory of Computing (STOC), pages 1283–1294, 2025. doi:10.1145/3717823.3718283.DOI
  8. [8]Naama Ben-David, Guy E. Blelloch, Michal Friedman, and Yuanhao Wei. Delay-free concurrency on faulty persistent memory. In Proceedings of the 31st ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 253–264, 2019. doi:10.1145/3323165.3323187.
  9. [9]Dante Bencivenga, Homa Habashi, and Philipp Woelfel. Efficient randomized LL/SC that preserves history independence. In Proceedings of the 40th International Symposium on Distributed Computing (DISC), volume 397 of LIPIcs, pages 12:1–12:24, 2026. doi:10.4230/LIPIcs.DISC.2026.12.DOI
  10. [10]Dante Bencivenga, Homa Habashi, and Philipp Woelfel. Efficient randomized LL/SC that preserves history independence. arXiv preprint, 2026. arXiv:2608.12946.DOI
  11. [11]Michael A. Bender, Jon Berry, Rob Johnson, Thomas M. Kroeger, Samuel McCauley, Cynthia A. Phillips, Bertrand Simon, Shikha Singh, and David Zage. Anti-persistence on persistent storage: History-independent sparse tables and dictionaries. In Proceedings of the 35th ACM SIGACT-SIGMOD Symposium on Principles of Database Systems, pages 289–302, 2016. doi:10.1145/2902251.2902276.
  12. [12]Guy E. Blelloch and Daniel Golovin. Strongly history-independent hashing with applications. In Proceedings of the 48th Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 272–282, 2007. doi:10.1109/FOCS.2007.36.DOI
  13. [13]Guy E. Blelloch and Yuanhao Wei. LL/SC and atomic copy: Constant time, space efficient implementations using only pointer-width CAS. In Proceedings of the 34th International Symposium on Distributed Computing (DISC), pages 5:1–5:17, 2020. doi:10.4230/LIPIcs.DISC.2020.5.DOI
  14. [14]Niv Buchbinder and Erez Petrank. Lower and upper bounds on obtaining history independence. Information and Computation, 204(2):291–337, 2006. doi:10.1016/J.IC.2005.11.001.DOI
  15. [15]Simon Doherty, Maurice Herlihy, Victor Luchangco, and Mark Moir. Bringing practical lock-free synchronization to 64-bit applications. In Proceedings of the 23rd ACM Symposium on Principles of Distributed Computing (PODC), pages 31–39, 2004. doi:10.1145/1011767.1011773.DOI
  16. [16]Wojciech Golab, Lisa Higham, and Philipp Woelfel. Linearizable implementations do not suffice for randomized distributed computation. In Proceedings of the 43rd Annual ACM Symposium on Theory of Computing (STOC), pages 373–382, 2011. doi:10.1145/1993636.1993687.DOI
  17. [17]Daniel Golovin. B-treaps: A uniquely represented alternative to B-trees. In Proceedings of the 36th International Colloquium on Automata, Languages, and Programming (ICALP), pages 487–499, 2009. doi:10.1007/978-3-642-02927-1_41.DOI
  18. [18]Daniel Golovin. The B-skip-list: A simpler uniquely represented alternative to B-trees. arXiv preprint, 2010. arXiv:1005.0662.arxiv.org/abs/1005.0662
  19. [19]Jason D. Hartline, Edwin S. Hong, Alexander E. Mohr, William R. Pentney, and Emily Rocke. Characterizing history independent data structures. In Proceedings of the 13th Annual International Symposium on Algorithms and Computation (ISAAC), pages 229–240, 2002. doi:10.1007/3-540-36167-2_21.
  20. [20]Jason D. Hartline, Edwin S. Hong, Alexander E. Mohr, William R. Pentney, and Emily C. Rocke. Characterizing history independent data structures. Algorithmica, 42(1):57–74, 2005. doi:10.1007/S00453-004-1140-Z.DOI
  21. [21]Maurice Herlihy. Wait-free synchronization. ACM Transactions on Programming Languages and Systems, 13(1):124–149, January 1991. doi:10.1145/114005.102808.DOI
  22. [22]Maurice P. Herlihy and Jeannette M. Wing. Linearizability: A correctness condition for concurrent objects. ACM Transactions on Programming Languages and Systems, 12(3):463–492, 1990. doi:10.1145/78969.78972.DOI
  23. [23]Amos Israeli and Lihu Rappoport. Disjoint-access-parallel implementations of strong shared memory primitives. In Proceedings of the 13th ACM Symposium on Principles of Distributed Computing (PODC), pages 151–160, 1994. doi:10.1145/197917.198079.DOI
  24. [24]Prasad Jayanti. A complete and constant time wait-free implementation of CAS from LL/SC and vice versa. In Proceedings of the 12th International Symposium on Distributed Computing (DISC), volume 1499 of Lecture Notes in Computer Science, pages 216–230, 1998. doi:10.1007/BFb0056485.DOI
  25. [25]Prasad Jayanti, Siddhartha Jayanti, and Sucharita Jayanti. Durable algorithms for writable LL/SC and CAS with dynamic joining. In Proceedings of the 27th International Symposium on Distributed Computing (DISC), volume 281 of LIPIcs, pages 25:1–25:20, 2023. doi:10.4230/LIPIcs.DISC.2023.25.DOI
  26. [26]Prasad Jayanti and Srdjan Petrovic. Efficient and practical constructions of LL/SC variables. In Proceedings of the 22nd ACM Symposium on Principles of Distributed Computing (PODC), pages 285–294, 2003. doi:10.1145/872035.872078.DOI
  27. [27]Prasad Jayanti and Srdjan Petrovic. Efficient wait-free implementation of multiword LL/SC variables. In Proceedings of the 25th International Conference on Distributed Computing Systems (ICDCS), pages 59–68, 2005. doi:10.1109/ICDCS.2005.29.DOI
  28. [28]Prasad Jayanti and Srdjan Petrovic. Efficiently implementing a large number of LL/SC objects. In Proceedings of 9th International Conference On Principles Of Distributed Systems (OPODIS), pages 17–31, 2005. doi:10.1007/11795490_4.DOI
  29. [29]Prasad Jayanti and Srdjan Petrovic. Efficiently implementing LL/SC objects shared by an unknown number of processes. In International Workshop on Distributed Computing (IWDC 2005), pages 45–56, 2005. doi:10.1007/11603771_5.DOI
  30. [30]Chaitanya Koparkar. A primer on pointer tagging. XRDS: Crossroads, The ACM Magazine for Students, 29(1):66–68, 2022. doi:10.1145/3558200.DOI
  31. [31]Linux man-pages project. proc_sys_kernel(5): Control a Range of Kernel Parameters. February 2026. Version 6.19, accessed November 22, 2026. URL: https://man7.org/linux/man-pages/man5/proc_sys_kernel.5.html.
  32. [32]Victor Luchangco, Mark Moir, and Nir Shavit. Nonblocking k-compare-single-swap. In Proceedings of the 25th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 314–323, 2003. doi:10.1145/777412.777468.DOI
  33. [33]Daniele Micianico. Oblivious data structures: applications to cryptography. In Proceedings of the 29th Annual ACM Symposium on Theory of Computing (STOC), pages 456–464, 1997. doi:10.1145/258533.258638.
  34. [34]Maged M. Michael. Practical lock-free and wait-free LL/SC/VL implementations using 64-bit CAS. In Proceedings of the 18th International Symposium on Distributed Computing (DISC), pages 144–158, 2004. doi:10.1007/978-3-540-30186-8_11.DOI
  35. [35]Mark Moir. Practical implementations of non-blocking synchronization primitives. In Proceedings of the 16th ACM Symposium on Principles of Distributed Computing (PODC), pages 219–228, 1997. doi:10.1145/259380.259442.DOI
  36. [36]Fatemeh Naderi-Sem iromi and Philipp Woelfel. Strongly linearizable LL/SC from CAS. In Proceedings of the 43rd ACM Symposium on Principles of Distributed Computing (PODC), pages 443–453, 2024. doi:10.1145/3665288.3662800.
  37. [37]Moni Naor, Gil Segev, and Udi Wieder. History-independent cuckoo hashing. In Proceedings of the 35th International Colloquium on Automata, Languages, and Programming (ICALP), pages 631–642, 2008. doi:10.1007/978-3-540-70583-3_51.DOI
  38. [38]Moni Naor and Vanessa Teague. Anti-persistence: history independent data structures. In Proceedings of the 33rd Annual ACM Symposium on Theory of Computing (STOC), pages 492–501, 2001. doi:10.1145/380752.380844.DOI
  39. [39]Julian Shun and Guy E. Blelloch. Phase-concurrent hash tables for determinism. In Proceedings of the 26th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA), pages 96–107, 2014. doi:10.1145/2612669.2612687.DOI

Paper details

vlnc:W_f85rg7p4
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 4

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents