We present and analyze a wait-free deterministic algorithm for solving the at-most-once problem: how m shared-memory fail-prone processes perform asynchronously n jobs at most once. Our algorithmic strategy provides for the first time nearly optimal effectiveness, which is a measure that expresses the total number of jobs completed in the worst case. The effectiveness of our algorithm equals n − 2m + 2. This is up to an additive factor of m close to the known effectiveness upper bound n − m + 1 over all possible algorithms and improves on the previously best known deterministic solutions that have effectiveness only n − log m · o(n). We also present an iterative version of our algorithm that for any m = O( 3+ǫ n/ log n) is both effectiveness-optimal and work-optimal, for any constant ǫ > 0. We then employ this algorithm to provide a new algorithmic solution for the Write-All problem which is work optimal for any m = O( 3+ǫ n/ log n).
1The problem becomes very challenging for autonomous processes in a system with concurrent invocations on multiple objects. At-most-once semantics have been thoroughly studied in the context of at-most-once message delivery [8,30,33] and at-most-once process invocation for RPC [6,31,37]. However, finding effective solutions for asynchronous shared-memory multiprocessors, in terms of how many at-most-once invocations can be performed by the cooperating processes, is largely an open problem. Solutions for the at-most-once problem, using only atomic read/write memory, and without specialized hardware support such as conditional writing, provide a useful tool in reasoning about the safety properties of applications developed for a variety of multiprocessor systems, including those not supporting bus-interlocking instructions and multi-core systems. Specifically, in recent years, attention has shifted from increasing clock speed towards chip multiprocessing, in order to increase the performance of systems. Because of the differences in each multi-core system, asynchronous shared memory is becoming an important abstraction for arguing about the safety properties of parallel applications in such systems. In the next years, one can expect chip multiprocessing to appear in a wide range of applications, many of which will have components that need to satisfy at-most-once semantics in order to guarantee safety. Such applications may include autonomous robotic devices, robotic devices for assisted living, automation in production lines or medical facilities. In such applications performing specific jobs at-most-once may be of paramount importance for safety of patients, the workers in a facility, or the devices themselves. Such jobs could be the triggering of a motor in a robotic arm, the activation of the X-ray gun in an X-ray machine, or supplying a dosage of medicine to a patient.Perhaps the most important question in this area is devising algorithms for the at-most-once problem with good effectiveness. The complexity measure of effectiveness [26] describes the number of jobs completed (at-mo...