c - Any systematic way to avoid "reentry" problem? (embedded system) -


We are using C to create a system on the ARM core (i.e. an embedded system). The question is how can we avoid the problem of re-establishment in a formal way so that we are confident that all retrieval bugs have been removed. This is not a practical desire, but certainly important for any system, I think.

Just to discuss, I think that the UML diagram is to be painted or the whole state machine will be good starting (but how did it develop after the whole system?). Any suggestions about using state machine / UML diagram for analysis?

I am not at all sure about the problem you want to solve but I Let's make an educated guess.

The first point is to identify the tasks that can be problematic. A recent is either by a recursive call, which can go to multiple nested calls and can also be hidden by the callback / dependency injection or the function used within several threads.

You can draw a guided call graph. Say the function is a call B and C, function B call D, E and F, nothing is function C, and so on. Drag it to each thread when multithreading If there are cycles in the graph, then all the works that make up this cycle should be re-protected. You can ignore sub-branches in this case. Work used in many threads should also be safe, but now all sub-branches are included, because you do not know exactly where each thread is currently.

This step is definitely a code Analysis can be automated by the device.

Now when the task is identified,

  • Functions that rely on function-local data are usually safe, in the good qualities of functional programming. One is from
  • External data (functions within scope) should be closely examined, it is especially important to know when and where the external data has changed.
  • External data should be used to change the red flag and activate a large alarm siren, especially when multithreading.

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -