%0 Journal Article %A DONG Shicheng %A ZHANG Yang %T Intelligent recommendation method for lock mechanism in concurrent program %D 2021 %R 10.11772/j.issn.1001-9081.2020121929 %J Journal of Computer Applications %P 1597-1603 %V 41 %N 6 %X The choices of Java locks are faced by the developers during parallel programming. To solve the problem of how to choose the appropriate lock mechanism to improve the program performance, a recommendation method named LockRec for developers of concurrent program to choose lock mechanism was proposed. Firstly, the program static analysis technology was used to analyze the use of lock mechanism in concurrent programs and determine the program feature attributes that affect the program performance. Then, the improved random forest algorithm was used to build a recommendation model of lock mechanism, so as to help the developers to choose the lock among synchronization lock, re-entrant lock, read-write lock, and stamped lock. Four existing machine learning datasets were selected to experiment with LockRec. The average accuracy of the proposed LockRec is 95.1%. In addition, the real-world concurrent programs were used to analyze the recommendation results of LockRec. The experimental results show that LockRec can effectively improve the execution efficiency of concurrent programs. %U http://www.joca.cn/EN/10.11772/j.issn.1001-9081.2020121929