We present a non-blocking algorithm for a concurrent heap in asynchronous shared memory multiprocessors. Processors in these machines often execute instructions at varying speeds and are subject to arbitrarily long delays. Our implementation supports Non-blocking Insert, Delete, and Find-Min operations on a heap. Non-blocking techniques avoid the drawbacks associated with mutual exclusion and also admit improved parallelism. Insert and DeleteMin operations in heap take more than one atomic instruction to complete, thus, it is possible that a new operation may be started before the previous one completes, leaving heap inconsistent between operations. We have represented heap as an array of pointers. Any modification to the heap is done by using single-word Compareu26Swap instructions. If all update operations modify different parts of the heap, they run completely concurrently. Our approach guarantees lock-freedom for all concurrent threads and wait-freedom if threads execute operations on different nodes of the heap.
展开▼