Continuation-Passing C:通过continuation将线程编译为事件
Continuation-Passing C: compiling threads to events through continuations
摘要:
在本文中,我们介绍了连续传递C(CPC),一个程序设计语言的并发系统中,本地和合作线程是统一的,并提交给程序员作为一个单一的抽象。CPC编译器使用基于CPS转换的编译技术,可以生成高效的代码和极其轻量级的上下文表示。我们提供了一个证明我们的编译方案的正确性。我们表明,特别是,升降机,一种常见的编译技术的函数式语言,也是正确的,在一个命令式语言,如C,在某些条件下强制执行的CPC编译器。目前的CPC编译器已经足够成熟,可以编写大量的程序,比如Hekate,一个高度并发的BitTorrent种子程序。我们的基准测试结果表明,CPC是有效的,而使用显着更少的空间,作为最有效的线程库可用。
英文摘要:
In this paper, we introduce Continuation Passing C (CPC), a programming language for concurrent systems in which native and cooperative threads are unified and presented to the programmer as a single abstraction. The CPC compiler uses a compilation technique, based on the CPS transform, that yields efficient code and an extremely lightweight representation for contexts. We provide a proof of the correctness of our compilation scheme. We show in particular that lambda-lifting, a common compilation technique for functional languages, is also correct in an imperative language like C, under some conditions enforced by the CPC compiler. The current CPC compiler is mature enough to write substantial programs such as Hekate, a highly concurrent BitTorrent seeder. Our benchmark results show that CPC is as efficient, while using significantly less space, as the most efficient thread libraries available.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。