Provided are a method, system, and program to allocate tasks among a
plurality of processes within a distributed processing environment. Each
process secures a list of elements and performs a first operation on an
element of the list to produce a result corresponding to one of the
processes. If the result corresponds to the process processing the
element, the process performs a second operation on the element. Each
process then processes the next element on the list until all the
elements of the list are processed. After the process processes all the
elements on the list it further processes each element remaining on the
list and performs the second operation on the elements remaining on the
list. In one implementation, the distributed processing environment is a
peer-to-peer virtual storage system and each process runs on a controller
controlling a plurality of storage systems.