Local variables. Each process pi manages the following local variables: parti is used to locally store a copy of the snapshot object PART ; counti is a local counter; and groupi a binary variable whose value belongs to {1, 2}. Behavior of a process pi. Algorithm 1 describes the behavior of a process pi. When it invokes propose(ini) (where ini is the value it proposes), pi first indicates it is participating (line 1). Then it invokes the snapshot object until at least n t processes are participating (lines 2-4). When this oc- curs, pi enters group 1 or group 2 according to the value of its counter counti (line 5), and launches in parallel two threads T 1 and T 2 (line 6). In the thread T 1, pi loop forever until DEC contains a proposed value. When this happens pi decides it (line 7). The execution of return() at line 7 or 12 terminates the invocation of propose(). The thread T 2 is the core of the algorithm. Process pi tries to enter the critical section controlled by either the f -mutex or the m-mutex object MUTEX [groupi] (line 9). If it succeeds and DEC has still its initial default value, pi assigns it the value ini it proposed (line 10). Finally, pi releases the critical section (line 11), and decides (line 12). Let us remind that, as far as MUTEX [1] (respectively, MUTEX [2]) is concerned, up to f (respectively, m) processes can simultaneously execute line 10.
Appears in 3 contracts
Sources: K Set Agreement and Renaming in the Presence of Contention Related Crash Failures, K Set Agreement and Renaming in the Presence of Contention Related Crash Failures, K Set Agreement and Renaming in the Presence of Contention Related Crash Failures