A "wait-free" procedure can complete in a finite number of steps, regardless of the relative speeds of other threads.
A "lock-free" procedure guarantees progress of at least one of the threads executing the procedure. That means some threads can be delayed arbitrarily, but it is guaranteed that at least one thread makes progress at each step.
CAS:assuming the map hasn't changed since I last looked at it, copy it. Otherwise, start all over again.
Delay Update:In plain English, the loop says "I'll replace the old map with a new, updated one, and I'll be on the lookout for any other updates of the map, but I'll only do the replacement when the reference count of the existing map is one."
posted on 2010-07-20 16:58
豪 阅读(795)
评论(0) 编辑 收藏 引用