A method and computer system for implementing, in a multithreaded
environment, an almost non-blocking linked list allow a lock-free access
provided that certain conditions are met. The approach involves:
associating a pointer and an auxiliary data structure with each linked
list, using a compare-and-swap (CAS) operation, and making a slight
modification of values associated with nodes under certain conditions.
The CAS operation guards against setting the pointers incorrectly during
insertion and removal operations. The auxiliary data structure, also
referred to as the `black list,` holds a dynamic list of values,
typically pointer values, associated with nodes that are in the process
of being removed by a thread.