支持Java中期货的异常处理

Lingli Zhang, C. Krintz, P. Nagpurkar
{"title":"支持Java中期货的异常处理","authors":"Lingli Zhang, C. Krintz, P. Nagpurkar","doi":"10.1145/1294325.1294349","DOIUrl":null,"url":null,"abstract":"A future is a simple and elegant construct that programmers can use to identify potentially asynchronous computation and to introduce parallelism into serial programs. In its recent 5.0 release, Java provides an interface-based implementation of futures that enables users to encapsulate potentially asynchronous computation and to define their own execution engines for futures. In prior work, we have proposed an alternative model, called directive-based lazy futures (DBLFutures), to support futures in Java, that simplifies Java programmer effort and improves performance and scalability of future-based applications. In the DBLFuture model, programmers use a new directive, \"@future\", to specify potentially concurrent computations within a serial program. DBLFutures enable programmers to focus on the logic and correctness of a program in the serial version first, and then to introduce parallelism gradually and intuitively. Moreover, DBLFutures provide greater flexibility to the Java virtual machine for efficient future support.\n In this paper, we investigate the exception handling aspect of futures in Java. In Java 5.0 Future APIs, exceptions of future execution are propagated to the point in the program at which future values are queried (used). We show that this exception handling model is not appropriate or desirable for DBLFutures. Instead, we propose an as-if-serial exception handling mechanism for DBL-Futures in which the system delivers exceptions at the same point as they would be delivered if the program was executed sequentially. Our approach, we believe, provides programmers with intuitive exception handling behavior and control. We present the design and implementation of our approach within the DBLFuture framework in the Jikes Research Virtual Machine. Our results show that our implementation introduces negligible overhead for applications without exceptions, and guarantees serial semantics of exception handling for applications that throw exceptions.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"48 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2007-09-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"27","resultStr":"{\"title\":\"Supporting exception handling for futures in Java\",\"authors\":\"Lingli Zhang, C. Krintz, P. Nagpurkar\",\"doi\":\"10.1145/1294325.1294349\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"A future is a simple and elegant construct that programmers can use to identify potentially asynchronous computation and to introduce parallelism into serial programs. In its recent 5.0 release, Java provides an interface-based implementation of futures that enables users to encapsulate potentially asynchronous computation and to define their own execution engines for futures. In prior work, we have proposed an alternative model, called directive-based lazy futures (DBLFutures), to support futures in Java, that simplifies Java programmer effort and improves performance and scalability of future-based applications. In the DBLFuture model, programmers use a new directive, \\\"@future\\\", to specify potentially concurrent computations within a serial program. DBLFutures enable programmers to focus on the logic and correctness of a program in the serial version first, and then to introduce parallelism gradually and intuitively. Moreover, DBLFutures provide greater flexibility to the Java virtual machine for efficient future support.\\n In this paper, we investigate the exception handling aspect of futures in Java. In Java 5.0 Future APIs, exceptions of future execution are propagated to the point in the program at which future values are queried (used). We show that this exception handling model is not appropriate or desirable for DBLFutures. Instead, we propose an as-if-serial exception handling mechanism for DBL-Futures in which the system delivers exceptions at the same point as they would be delivered if the program was executed sequentially. Our approach, we believe, provides programmers with intuitive exception handling behavior and control. We present the design and implementation of our approach within the DBLFuture framework in the Jikes Research Virtual Machine. Our results show that our implementation introduces negligible overhead for applications without exceptions, and guarantees serial semantics of exception handling for applications that throw exceptions.\",\"PeriodicalId\":169989,\"journal\":{\"name\":\"Principles and Practice of Programming in Java\",\"volume\":\"48 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2007-09-05\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"27\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Principles and Practice of Programming in Java\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/1294325.1294349\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Principles and Practice of Programming in Java","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1294325.1294349","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 27

摘要

future是一个简单而优雅的结构,程序员可以用它来识别潜在的异步计算,并在串行程序中引入并行性。在最近的5.0版本中,Java提供了基于接口的期货实现,使用户能够封装潜在的异步计算,并为期货定义自己的执行引擎。在之前的工作中,我们提出了一种替代模型,称为基于指令的延迟期货(DBLFutures),以支持Java中的期货,这简化了Java程序员的工作,并提高了基于未来的应用程序的性能和可伸缩性。在DBLFuture模型中,程序员使用一个新的指令“@future”来指定串行程序中潜在的并发计算。DBLFutures使程序员能够首先关注串行版本中程序的逻辑和正确性,然后逐步直观地引入并行性。此外,dbfutures为Java虚拟机提供了更大的灵活性,以实现高效的未来支持。在本文中,我们研究了Java中期货的异常处理方面。在Java 5.0 Future api中,未来执行的异常被传播到程序中查询(使用)未来值的点。我们表明,这种异常处理模型不适合或不适合DBLFutures。相反,我们为DBL-Futures提出了一种类似串行的异常处理机制,在这种机制中,系统在程序顺序执行时交付异常的同一点交付异常。我们相信,我们的方法为程序员提供了直观的异常处理行为和控制。我们在Jikes Research虚拟机的DBLFuture框架中展示了我们的方法的设计和实现。我们的结果表明,我们的实现为没有异常的应用程序引入了可以忽略不计的开销,并保证了抛出异常的应用程序的异常处理的串行语义。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
Supporting exception handling for futures in Java
A future is a simple and elegant construct that programmers can use to identify potentially asynchronous computation and to introduce parallelism into serial programs. In its recent 5.0 release, Java provides an interface-based implementation of futures that enables users to encapsulate potentially asynchronous computation and to define their own execution engines for futures. In prior work, we have proposed an alternative model, called directive-based lazy futures (DBLFutures), to support futures in Java, that simplifies Java programmer effort and improves performance and scalability of future-based applications. In the DBLFuture model, programmers use a new directive, "@future", to specify potentially concurrent computations within a serial program. DBLFutures enable programmers to focus on the logic and correctness of a program in the serial version first, and then to introduce parallelism gradually and intuitively. Moreover, DBLFutures provide greater flexibility to the Java virtual machine for efficient future support. In this paper, we investigate the exception handling aspect of futures in Java. In Java 5.0 Future APIs, exceptions of future execution are propagated to the point in the program at which future values are queried (used). We show that this exception handling model is not appropriate or desirable for DBLFutures. Instead, we propose an as-if-serial exception handling mechanism for DBL-Futures in which the system delivers exceptions at the same point as they would be delivered if the program was executed sequentially. Our approach, we believe, provides programmers with intuitive exception handling behavior and control. We present the design and implementation of our approach within the DBLFuture framework in the Jikes Research Virtual Machine. Our results show that our implementation introduces negligible overhead for applications without exceptions, and guarantees serial semantics of exception handling for applications that throw exceptions.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Optimizing interpreters by tuning opcode orderings on virtual machines for modern architectures: or: how I learned to stop worrying and love hill climbing A DSL for writing type systems for Xtext languages ejIP: a TCP/IP stack for embedded Java Habanero-Java: the new adventures of old X10 Eliminating partially-redundant array-bounds check in the Android Dalvik JIT compiler
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1