首页> 外文会议>ACM SIGPLAN Conference on Programming Language Design and Implementation >AutoSynch: An Automatic-Signal Monitor Based on Predicate Tagging
【24h】

AutoSynch: An Automatic-Signal Monitor Based on Predicate Tagging

机译:AutoSynch:基于谓词标记的自动信号监视器

获取原文

摘要

Most programming languages use monitors with explicit signals for synchronization in shared-memory programs. Requiring programmers to signal threads explicitly results in many concurrency bugs due to missed notifications, or notifications on wrong condition variables. In this paper, we describe an implementation of an automatic signaling monitor in Java called AutoSynch that eliminates such concurrency bugs by removing the burden of signaling from the programmer. We show that the belief that automatic signaling monitors are prohibitively expensive is wrong. For most problems, programs based on AutoSynch are almost as fast as those based on explicit signaling. For some, AutoSynch is even faster than explicit signaling because it never uses signalAll, whereas the programmers end up using signalAll with the explicit signal mechanism. AutoSynch achieves efficiency in synchronization based on three novel ideas. We introduce an operation called closure that enables the predicate evaluation in every thread, thereby reducing context switches during the execution of the program. Secondly, AutoSynch avoids signalAll by using a property called relay invariance that guarantees that whenever possible there is always at least one thread whose condition is true which has been signaled. Finally, AutoSynch uses a technique called predicate tagging to efficiently determine a thread that should be signaled. To evaluate the efficiency of AutoSynch, we have implemented many different well-known synchronization problems such as the producers/consumers problem, the readers/writers problems, and the dining philosophers problem. The results show that AutoSynch is almost as efficient as the explicit-signal monitor and even more efficient for some cases.
机译:大多数编程语言使用具有显式信号的监视器,用于共享内存程序中的同步。要求程序员以信号线程明确导致由于未接示的通知导致的许多并发错误,或错误条件变量上的通知。在本文中,我们描述了在名为AutoSynch中的Java中自动信令监视器的实现,通过从程序员中移除信令的负担来消除此类并发错误。我们表明,自动信令监视器对昂贵的信念是错误的。对于大多数问题,基于AutoSynch的程序几乎与基于显式信令的程序一样快。对于某些而言,AutoSynch甚至比显式信令快,因为它永远不会使用信号,而程序员最终将使用具有显式信号机制的信号。基于三个新颖思想,AutoSynch实现了同步的效率。我们介绍一个名为Closure的操作,使得能够在每个线程中进行谓词评估,从而在执行程序期间减少上下文切换。其次,AutoSynch避免了通过使用称为中继不变性的属性来避免SignalAl,以保证尽可能有至少一个线程,其条件已发出信号。最后,AutoSynch使用称为谓词标记的技术,以有效地确定应该发信号通知的线程。为了评估AutoSynch的效率,我们已经实施了许多不同的众所周知的同步问题,例如生产者/消费者问题,读者/作家问题以及餐饮哲学家问题。结果表明,AutoSynch几乎与显式信号监视器有效,并且对于某些情况而言更有效。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号