Page 62 - 《软件学报》2021年第12期
P. 62

3726                                Journal of Software  软件学报 Vol.32, No.12, December 2021

         析等多种程序分析技术对读写模式进行分析,并设计了基于下推自动机的锁模式识别方法.以 Eclipse 插件的形
         式实现了自动重构工具 FLock,在 HSQLDB,Jenkins 和 Cassandra 等 11 个开源项目中使用该重构工具,对本文提
         出的方法进行了验证.实验中总计重构了 1 757 个监视器对象,每个程序重构平均用时 17.5s.与手动重构相比,
         可以有效提升重构效率.实验结果表明,该重构工具可以有效地实现粗粒度锁到细粒度锁的转换.我们下一步的
         工作包括:1)  探索更多的细粒度锁的重构模式,尝试发现更多的可以使用细粒度锁的场景;2)  使用更多实际应
         用程序对 FLock 进行测试;3)  完善重构工具 FLock,通过比较使用粗粒度锁和细粒度锁的程序性能,在重构算法
         中加入性能权衡,帮助程序员在粗粒度锁和细粒度锁之间做出选择,进而决定是否进行重构.

         References:
          [1]    Tao B, Qian J. Refactoring Java concurrent programs based on synchronization requirement analysis. In: Proc. of the 2014 IEEE
             Int’l Conf. on Software Maintenance and Evolution. IEEE, 2014. 361−370. [doi: 10.1109/ICSME.2014.58]
          [2]    Yu T, Pradel M. SyncProf: Detecting, localizing, and optimizing synchronization bottlenecks. In: Zeller A, ed. Proc. of the 25th
             Int’l Symp. on Software Testing and Analysis. ACM, 2016. 389−400. [doi: 10.1145/2931037.2931070]
          [3]    Emmi M,  Fischer JS,  Jhala R,  et al.  Lock allocation. In:  Hofmann M, ed.  Proc.  of  the ACM  SIGPLAN Notices. ACM,  2007.
             291−296. [doi: 10.1145/1190216.1190260]
          [4]    Kawachiya K, Koseki A, Onodera T. Lock reservation: Java locks can mostly do without atomic operations. In: Ibrahim M, ed.
             Proc. of the ACM SIGPLAN Notices. ACM, 2002. 130−141. [doi: 10.1145/582419.582433]
          [5]    Schafer M, Sridharan M, Dolby J, et al. Refactoring Java programs for flexible locking. In: Taylor RN, ed. Proc. of the 2011 33rd
             Int’l Conf. on Software Engineering (ICSE). IEEE, 2011. 71−80. [doi: 10.1145/1985793.1985804]
          [6]    Zhang Y, Shao S, Liu H, et al. Refactoring Java programs for customizable locks based on bytecode transformation. IEEE Access,
             2019,7:66292−66303. [doi: 10.1109/ACCESS.2019.2919203]
          [7]    Zhang Y, Dong S, Zhang X, et al. Automated refactoring for stampedlock. IEEE Access, 2019,7:104900−104911. [doi: 10.1109/
             ACCESS.2019.2931953]
          [8]    Arbel M, Golan-Gueta G, Hillel E, et al. Towards automatic lock removal for scalable synchronization. In: Moses Y, ed. Proc. of
             the Int’l Symp. on Distributed Computing. Springer-Verlag, 2015. 170−184. [doi:10.1007/978-3-662-48653-5\_12]
          [9]    Bavarsad AG, Atoofian E. Read-write lock allocation in software transactional memory. In: Proc. of the 2013 42nd Int’l Conf. on
             Parallel Processing. IEEE, 2013. 680−687. [doi:10.1109/ICPP.2013.81]
         [10]    Locksmith.https://intellij-support.jetbrains.com/hc/en-us/community/posts/206761105%E2%80%93Ann-LockSmith-concurrency-or
             iented-refactorings-for-IntelliJ-IDEA
         [11]    Concurrency-related refactorings for JDT. https://wiki.eclipse.org/Concurrency-related_refactorings_for_JDT
         [12]    Pinto G, Torres W, Fernandes B, et al. A large-scale study on the usage of Java’s concurrent programming constructs. Journal of
             Systems and Software, 2015,106:59−81. [doi: 10.1016/j.jss.2015.04.064]
         [13]    https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html
         [14]    Eclipse JDT. https://www.eclipse.org/jdt/
         [15]    Ghezzi C, Jazayeri M. Programming Language Concepts. 3rd ed., New York: John Wiley & Sons, 2008. 214−220.
         [16]    WALA. http://wala.sourceforge.net/wiki/index.php/Main_Page
         [17]    Zhang C. FlexSync: An aspect-oriented approach to Java synchronization. In: Proc. of the 2009 IEEE 31st Int’l Conf. on Software
             Engineering. IEEE, 2009. 375−385. [doi: 10.1109/ICSE.2009.5070537]
         [18]    Shao S.  An  automated refactoring  approach for fine-grained lock [MS.  Thesis]. Shijiazhuang:  Hebei  University of Science  and
             Technology. 2020 (in Chinese with English abstract).
         [19]    HSQLDB. http://hsqldb.org/
         [20]    Jenkins. https://jenkins.io/zh
         [21]    Cassandra. https://cassandra.apache.org/
         [22]    SPECjbb2005.https://www.spec.org/jbb2005/
         [23]    JGroups. http://www.jgroups.org/
         [24]    Xalan. http://xalan.apache.org/xalan-j/
         [25]    Fop. https://xmlgraphics.apache.org/fop/
         [26]    RxJava. http://reactivex.io/
         [27]    Freedomotic. https://www.freedomotic-iot.com
         [28]    Antlr. https://www.antlr.org/
         [29]    MINA. http://mina.apache.org/
   57   58   59   60   61   62   63   64   65   66   67