PLAM: Preemptive Layer Activation Architecture based on Multithreading in Context-Oriented Programming

In recent years, with the development of embedded software, the demand for context-aware software and the need for Context-Oriented Programming (COP) frameworks is increasing. In general, within the COP framework, each method is managed in units of layers, and time is required to activate the layers following context changes. Compared to the traditional single-thread method, the use of multi-threading to control the layer activation doubles the system efficiency. Moreover, embedded software usually includes mechanisms for exception handling, such as communication disconnection, mechanical or hardware failures, and insufficient energy. These mechanisms are expected to be types of high-priority operations, which also require multi-threading to achieve preemptive layer activation. In this study, we propose an architecture for preemptive layer activation known as PLAM by using multi-threading, which is based on the RTCOP framework. Using PLAM, the non-exception handling layers can be activated simultaneously, and when the context of the exception handling layer is perceived, the program can call a certain function to suspend or terminate the activation process of the other layers. Finally, we package a series of functions as APIs so that users can use these to customize the context listener. A test application confirms the feasibility of the proposed approach.

[1]  Takeshi Ohkawa,et al.  Prototype of FPGA Dynamic Reconfiguration Based-on Context-Oriented Programming , 2019, 2019 IEEE 13th International Symposium on Embedded Multicore/Many-core Systems-on-Chip (MCSoC).

[2]  Sauro Longhi,et al.  Autonomous navigation, landing and recharge of a quadrotor using artificial vision , 2014, 2014 International Conference on Unmanned Aircraft Systems (ICUAS).

[3]  Félix García,et al.  POSIX thread libraries , 2000 .

[4]  Oscar Nierstrasz,et al.  Context-oriented Programming , 2008, J. Object Technol..

[5]  Midori Sugaya,et al.  A Study of Context-Oriented Programming for Applying to Robot Development , 2015, COP@ECOOP.

[6]  Michael Haupt,et al.  ContextJ: Context-oriented Programming with Java , 2011 .

[7]  Andreas Polze,et al.  Self-adaptive multithreaded applications: a case for dynamic aspect weaving , 2005, ARM '05.

[8]  Jade Alglave,et al.  Synchronising C/C++ and POWER , 2012, PLDI.

[9]  Midori Sugaya,et al.  A structure of a c# framework ContextCS based on context-oriented programming , 2015, MODULARITY.

[10]  Andry Rakotonirainy,et al.  Context-oriented programming , 2003, MobiDe '03.

[11]  Tetsuo Tamai,et al.  Context-oriented software engineering: a modularity vision , 2014, MODULARITY.

[12]  Akira Fukuda,et al.  RTCOP: Context-Oriented Programming Framework based on C++ for Application in Embedded Software , 2019 .

[13]  Robert Hirschfeld,et al.  An open implementation for context-oriented layer composition in ContextJS , 2011, Sci. Comput. Program..

[14]  Thomas Fahringer,et al.  On the Quality of Implementation of the C++11 Thread Support Library , 2015, 2015 23rd Euromicro International Conference on Parallel, Distributed, and Network-Based Processing.