An apparatus and method for distributing work on a doubly linked list to a
plurality of worker threads are provided. With the apparatus and method,
an initial thread obtains the list lock for the linked list and inserts a
marker element at the beginning of the linked list. Elements in the
linked list that are before the marker element in the linked list are
considered work that has been assigned or work that has been completed.
Elements of the linked list that are after the marker element in the
linked list are work to be done. The initial thread spawns worker threads
to perform the work on the linked list and passes the address of the
marker element to each of the worker threads. Each worker thread then
operates independently to perform work on the linked list based on the
current position of the marker element in the linked list.