幂等的I/O用于安全的时间旅行
Idempotent I/O for safe time travel
摘要:
逻辑程序设计语言的调试器传统上具有大多数其他调试器所没有的能力:跳回程序的先前状态的能力,有效地在计算历史中进行时间旅行。这种"重试“功能非常有用,允许程序员详细检查他们以前跳过的计算部分。不幸的是,它也产生了一个问题:虽然调试器可能能够恢复变量的先前值,但它不能恢复受I/O操作影响的程序状态部分。如果被跳回的计算部分执行I/O,那么程序将执行这些I/O操作两次,这将导致不必要的影响,从良性的(例如输出出现两次)到致命的(例如试图关闭已经关闭的文件)。我们提出了一个简单的机制,以确保程序调用的每个I/O动作最多执行一次,即使程序员要求调试器从动作后到动作前的时间旅行。这种机制的开销足够低,并且可以很好地控制,从而可以实际使用它来调试执行大量I/O的计算。
英文摘要:
Debuggers for logic programming languages have traditionally had a capability most other debuggers did not: the ability to jump back to a previous state of the program, effectively travelling back in time in the history of the computation. This ``retry'' capability is very useful, allowing programmers to examine in detail a part of the computation that they previously stepped over. Unfortunately, it also creates a problem: while the debugger may be able to restore the previous values of variables, it cannot restore the part of the program's state that is affected by I/O operations. If the part of the computation being jumped back over performs I/O, then the program will perform these I/O operations twice, which will result in unwanted effects ranging from the benign (e.g. output appearing twice) to the fatal (e.g. trying to close an already closed file). We present a simple mechanism for ensuring that every I/O action called for by the program is executed at most once, even if the programmer asks the debugger to travel back in time from after the action to before the action. The overhead of this mechanism is low enough and can be controlled well enough to make it practical to use it to debug computations that do significant amounts of I/O.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。