arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1311.3200cs.DC
收藏

无锁并发算法实际上是无等待的吗?

Are Lock-Free Concurrent Algorithms Practically Wait-Free?

Dan Alistarh, Keren Censor-Hillel, Nir Shavit

摘要:

无锁并发算法保证某些并发操作总是在有限的步骤中进行。然而,程序员更喜欢将并发代码视为无等待的代码,以保证所有操作总是进行。不幸的是,设计无等待算法通常是一项非常复杂的任务,并且由此产生的算法并不总是有效的。虽然获得有效的无等待算法一直是理论界的长期目标,但大多数非阻塞商业代码只是无锁的。本文提出了一个简单的解决这个问题的方法。我们表明,对于一个大类的无锁算法,在调度条件下,在商业硬件架构中发现的近似,无锁算法的行为,如果他们是等待自由。换句话说,程序员可以继续设计简单的无锁算法,而不是复杂的无等待算法,在实践中,他们将获得无等待的进展。我们的主要贡献是一种新的方式分析下的随机调度一般类的无锁算法。我们的分析涉及到一个复杂的每进程链和一个简单的系统进程链之间的马尔可夫链提升的整体性能的进程。我们表明,无锁算法不仅等待免费的概率为1,但事实上,一个一般的子集的无锁算法可以密切限制的平均步骤数,直到操作完成。据我们所知,这是第一次尝试分析进展情况,通常是在一个最坏的情况下的对手,在一个随机模型捕捉他们的预期渐近行为。

英文摘要:

Lock-free concurrent algorithms guarantee that some concurrent operation will always make progress in a finite number of steps. Yet programmers prefer to treat concurrent code as if it were wait-free, guaranteeing that all operations always make progress. Unfortunately, designing wait-free algorithms is generally a very complex task, and the resulting algorithms are not always efficient. While obtaining efficient wait-free algorithms has been a long-time goal for the theory community, most non-blocking commercial code is only lock-free. This paper suggests a simple solution to this problem. We show that, for a large class of lock- free algorithms, under scheduling conditions which approximate those found in commercial hardware architectures, lock-free algorithms behave as if they are wait-free. In other words, programmers can keep on designing simple lock-free algorithms instead of complex wait-free ones, and in practice, they will get wait-free progress. Our main contribution is a new way of analyzing a general class of lock-free algorithms under a stochastic scheduler. Our analysis relates the individual performance of processes with the global performance of the system using Markov chain lifting between a complex per-process chain and a simpler system progress chain. We show that lock-free algorithms are not only wait-free with probability 1, but that in fact a general subset of lock-free algorithms can be closely bounded in terms of the average number of steps required until an operation completes. To the best of our knowledge, this is the first attempt to analyze progress conditions, typically stated in relation to a worst case adversary, in a stochastic model capturing their expected asymptotic behavior.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑