Ada 202 x中的安全非阻塞同步
Safe Non-blocking Synchronization in Ada 202x
摘要:
锁的互斥特性阻碍了众核体系结构上并行程序的可扩展性。锁不允许进度保证,因为任务可能会在临界区内失败,并保持一个阻止其他任务访问共享数据的锁。使用非阻塞同步,通过原子读-修改-写操作同步对共享数据的访问,避免了锁的缺点。为了在Ada~ 202 x中加入非阻塞同步,程序员必须能够在没有受保护对象和集合的情况下推理任务的行为和性能。因此,我们通过同步类型扩展了Ada的内存模型,这些类型支持足够详细的内存排序操作表达。为了减轻与非阻塞同步的复杂性,我们提出了并发对象作为一种新的高级语言构造。由于细粒度的乐观同步机制,并发对象的实体并行执行。同步是由并发条目执行的语义来定义的。程序员只需要在并发条目的代码中标记共享数据访问。标签构成了通过属性表示的内存排序操作。据我们所知,这是第一种将非阻塞同步构造作为高级程序设计语言的一等公民来提供的方法。我们通过几个例子来说明并发对象的使用。
英文摘要:
The mutual-exclusion property of locks stands in the way to scalability of parallel programs on many-core architectures. Locks do not allow progress guarantees, because a task may fail inside a critical section and keep holding a lock that blocks other tasks from accessing shared data. With non-blocking synchronization, the drawbacks of locks are avoided by synchronizing access to shared data by atomic read-modify-write operations. To incorporate non-blocking synchronization in Ada~202x, programmers must be able to reason about the behavior and performance of tasks in the absence of protected objects and rendezvous. We therefore extend Ada's memory model by synchronized types, which support the expression of memory ordering operations at a sufficient level of detail. To mitigate the complexity associated with non-blocking synchronization, we propose concurrent objects as a novel high-level language construct. Entities of a concurrent object execute in parallel, due to a fine-grained, optimistic synchronization mechanism. Synchronization is framed by the semantics of concurrent entry execution. The programmer is only required to label shared data accesses in the code of concurrent entries. Labels constitute memory-ordering operations expressed through attributes. To the best of our knowledge, this is the first approach to provide a non-blocking synchronization construct as a first-class citizen of a high-level programming language. We illustrate the use of concurrent objects by several examples.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。