计算机科学与探索 ›› 2010, Vol. 4 ›› Issue (3): 214-221.DOI: 10.3778/j.issn.1673-9418.2010.03.003

• 学术研究 • 上一篇    下一篇

一种支持多状态转换的通用资源池框架

马秀娟1,2,周明辉1,2+,梅 宏1,2   

  1. 1. 北京大学 计算机科学与技术系,北京 100084
    2. 北京大学 高可信软件技术教育部重点实验室,北京 100084
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2010-03-15 发布日期:2010-03-15
  • 通讯作者: 周明辉

An Enhanced Generic Pool Framework Supporting Multi-State Transferring

MA Xiujuan1,2, ZHOU Minghui1,2+, MEI Hong1,2   

  1. 1. School of Electronics Engineering and Computer Science, Peking University, Beijing 100084, China
    2. Key Lab of High Confidence Software Technologies, MOE, Peking University, Beijing 100084, China
  • Received:1900-01-01 Revised:1900-01-01 Online:2010-03-15 Published:2010-03-15
  • Contact: ZHOU Minghui

摘要: 在软件系统的开发中,系统的响应时间、资源消耗以及并发度越来越受到重视。同时,开发人员越来越多地使用中间件来提高开发效率和系统性能。池机制就是一种通过复用而不是每次都重新创建对象来解决系统性能的方式。为不同的资源对象开发不同的池将导致许多的重复工作和代码冗余。分析了当前许多池的特征,从中提取出四种共性:资源的借入借出、资源有效性检查、池的监测机制和池的可定制机制;扩展了Mark Grand的对象池模式,提出了一个通用池框架。在这个扩展池的基础上,通过研究资源的状态转换,首次提出一种细粒度的状态转换——对象的多状态转换机制。实验和分析结果证明了方法的有效性。

关键词: 通用池, 多状态转换, 池模式

Abstract: Nowadays, many software systems pay great attention to their response time, resource consumption and concurrency. Correspondingly, more and more middleware is used by these systems to improve developing efficiency and system performance. Pool mechanism has helped many systems to solve the performance problems by reusing big objects already created not creating them from beginning again. But at the same time, developers have to develop different kinds of pools for different resource objects, which lead to a lot of repeated work and code redundancies. After analyzing the features of current pools, this paper extracts four commonalities which are called kernel tasks, ensurance services, organization work and customization providing, and proposes a generic pool framework, which is an extension and enhancement of Mark Grand’s object pool pattern. Based on this enhanced pool, it brings out multi-state transferring mechanism from the viewpoint of state transferring. No other pools support this kind of fine-granularity state-transferring. Experiments and analysis show the validity of this method.

Key words: generic pool, multi-state transferring, pool pattern

中图分类号: