利用公共表空间实现多线程的局部制表
Towards Multi-Threaded Local Tabling Using a Common Table Space
摘要:
多线程目前由几个著名的Prolog系统支持,为可以从并发中受益的应用程序提供了高度可移植的解决方案。当多线程与制表相结合时,我们可以利用更高的过程控制和声明性语义的力量。然而,尽管在一些Prolog系统中线程和制表都是可用的,但这两个功能的实现意味着彼此之间以及与底层引擎之间的复杂联系。到目前为止,XSB是唯一一个结合了多线程和制表的Prolog系统。在XSB中,表可以是私有的,也可以在线程之间共享。虽然线程私有表更容易实现,但共享表具有锁定、同步和潜在死锁等所有相关问题。在本文中,我们提出了另一种观点XSB的方法。在我们的建议中,每个线程都将其表视为私有表,但在引擎级别,我们使用一个公共表空间,其中表在所有线程之间共享。我们为我们的公共表空间方法提出了三种设计:非共享(NS)(类似于XSB的私有表),子目标共享(SS)和完全共享(FS)。这项工作的主要目标是减少表空间的内存使用,但我们的实验结果,使用YapTab制表系统与本地评估策略,表明我们也可以实现显着减少运行时间。
英文摘要:
Multi-threading is currently supported by several well-known Prolog systems providing a highly portable solution for applications that can benefit from concurrency. When multi-threading is combined with tabling, we can exploit the power of higher procedural control and declarative semantics. However, despite the availability of both threads and tabling in some Prolog systems, the implementation of these two features implies complex ties to each other and to the underlying engine. Until now, XSB was the only Prolog system combining multi-threading with tabling. In XSB, tables may be either private or shared between threads. While thread-private tables are easier to implement, shared tables have all the associated issues of locking, synchronization and potential deadlocks. In this paper, we propose an alternative view to XSB's approach. In our proposal, each thread views its tables as private but, at the engine level, we use a common table space where tables are shared among all threads. We present three designs for our common table space approach: No-Sharing (NS) (similar to XSB's private tables), Subgoal-Sharing (SS) and Full-Sharing (FS). The primary goal of this work was to reduce the memory usage for the table space but, our experimental results, using the YapTab tabling system with a local evaluation strategy, show that we can also achieve significant reductions on running time.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。