无等待锁不应惧怕后来者
Wait-Free Locks Should Not Fear Later Arrivals
AI总结:
研究无等待锁中调用是否仅为获取票据时活跃请求负责,提出SeniorLock锁,具有追溯无等待特性,调用在特定步骤内完成,成本与后续调用无关,还兼作SeniorObj通用构造,能将特定顺序对象转变为追溯无等待对象。
AI中文摘要:
帮助机制似乎能使锁实现无等待:将临界区包裹在幂等函数中,一旦持有者停滞,任何进程都能完成。然而帮助机制保护的是系统而非调用。可覆盖候选者会让后来请求相互碰撞,导致调用可能被迫不断帮助新来者而无法返回,且争用点从不超过两个。我们探讨调用是否仅需为获取票据时活跃的请求负责,而非后续到达的请求。我们证明答案是肯定的。SeniorLock是一种确定性可帮助函数锁,具有票据时间资历β的调用在O((β + 1)(T + 1))个本地共享内存步骤内完成,其中T限制一个函数的成本,与后续调用无关。我们称此保证为“追溯无等待”。同一锁兼作通用构造SeniorObj:它将任何操作有界、并发幂等函数的确定性顺序对象转变为追溯无等待对象,无需复制其表示,且在无资历者活跃时,基本以操作的原生成本运行。
英文摘要:
Helping seems to make a lock wait-free: wrap the critical section in an idempotent thunk that any process can finish once the holder stalls. Yet helping protects the system, not the call. An overwritable candidate lets later requests bump one another in sequence, so a call can be forced to help newcomer after newcomer and never return, while point contention never exceeds two. We ask whether a call can instead be charged only for the requests active when it takes its ticket, never for what arrives afterward. We show that the answer is yes. SeniorLock is a deterministic helpable thunk lock in which a call with ticket-time seniority $β$ finishes in $O((β+1)(T+1))$ local shared-memory steps, where $T$ bounds one thunk's cost, independently of later invocations. We call this guarantee \emph{retrospective wait-freedom}. The same lock doubles as a universal construction we call SeniorObj: it turns any deterministic sequential object whose operations are bounded, concurrently idempotent thunks into a retrospective wait-free one, with no copying of its representation and, when no senior is active, at essentially the native cost of the operation.