Implementing and Testing Producer-Consumer Problem Using Aspect-Oriented Programming

Yang Zhang,Jingjun Zhang,Dongwen Zhang
DOI: https://doi.org/10.1109/ias.2009.41
2009-01-01
Abstract:Producer-Consumer problem is a classical and representative synchronization problem in the field of computer science, which can be implemented by object-oriented programming language. However, the implementation of object-oriented programming often leads to be tangled between functional codes and synchronization codes, which are easy to lead code-scattering and code-tangling. Aspect-oriented programming (AOP) has been proposed as a technique for improving separation of concerns for the final software. This paper aims to resolve concrete aspect and implement the synchronization of producer-consumer based on AOP under two ways: single buffer and multiple buffers, and the execution result shows that AOP can resolve the producer-consumer problem effectively. Furthermore, the execution time of AOP program is shown to contrast with that of object-oriented programming, which shows that AOP can almost get the same execution time with object-oriented programming, while AOP can gain the modularization better than object-oriented programming.
What problem does this paper attempt to address?