竞争主义:正确安排优先事项
Competitive Parallelism: Getting Your Priorities Right
摘要:
多线程程序传统上分为两个领域:合作和竞争。这两个领域在传统上大多保持不相交,协作线程用于提高计算密集型应用程序(如科学工作负载)的吞吐量,而协作线程用于提高交互式应用程序(如GUI和游戏)的响应能力。随着多核硬件变得越来越主流,有必要将这两个不相交的世界连接起来,因为许多应用程序将交互和计算混合在一起,并且将从协作线程和竞争线程中受益。在本文中,我们提出了技术的并行交互式应用程序,可以使用合作和竞争线程的编程和推理。我们的技术使程序员编写丰富的并行交互式程序,创建和同步线程需要,并通过分配线程用户定义的和部分有序的优先级。为了确保重要的响应特性,我们提出了一个模态类型系统类似于S4模态逻辑,排除低优先级线程延迟高优先级线程,从而静态地防止一组关键的优先级反转错误。然后,我们提出了一个成本模型,允许推理良好类型的程序的响应和完成时间。成本模型扩展了传统的工作跨度模型的合作线程,以考虑到竞争的调度决策,以确保响应。最后,我们证明了我们提出的技术是现实的,通过将它们实现为标准ML语言的扩展。
英文摘要:
Multi-threaded programs have traditionally fallen into one of two domains: cooperative and competitive. These two domains have traditionally remained mostly disjoint, with cooperative threading used for increasing throughput in compute-intensive applications such as scientific workloads and cooperative threading used for increasing responsiveness in interactive applications such as GUIs and games. As multicore hardware becomes increasingly mainstream, there is a need for bridging these two disjoint worlds, because many applications mix interaction and computation and would benefit from both cooperative and competitive threading. In this paper, we present techniques for programming and reasoning about parallel interactive applications that can use both cooperative and competitive threading. Our techniques enable the programmer to write rich parallel interactive programs by creating and synchronizing with threads as needed, and by assigning threads user-defined and partially ordered priorities. To ensure important responsiveness properties, we present a modal type system analogous to S4 modal logic that precludes low-priority threads from delaying high-priority threads, thereby statically preventing a crucial set of priority-inversion bugs. We then present a cost model that allows reasoning about responsiveness and completion time of well-typed programs. The cost model extends the traditional work-span model for cooperative threading to account for competitive scheduling decisions needed to ensure responsiveness. Finally, we show that our proposed techniques are realistic by implementing them as an extension to the Standard ML language.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。