Hazards in shared variable implementation We consider a multi-task application which uses a shared simple type variable,

Question:

Hazards in shared variable implementation We consider a multi-task application which uses a shared simple type variable, that is to say memorized in one single memory word. We will also suppose that all the modifications of this value are carried out directly, without local copies in the tasks, contrarily to what was presented in seetion 11.2.2.2. No design or programming problems exist therefore, and this communication mechanism between tasks seems to be without risk. Its utilization should even be encouraged due to its performance. This exercise aims at showing that faults are introduced by the implementation of this mechanism.

We study the implementation of reading and assignment statements for this variable. We will suppose that the microprocessor offers decrease and increase statements which act uniquely on the registers. By studying the code generated by the compiler for the extracts of two tasks, show how this brings us to the problem discussed in section 11.2.2.2.

Program:

Task 1 ;

1++;

end Task1.

Task 2 ;

1--;

end Task2.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Design Of Dependable Computing Systems

ISBN: 978-9048159413

1st Edition

Authors: J C Geffroy ,G Motet

Question Posted: