07-08-2019 07:45 AM
2. Consider the following scenario: You have multiple acquisition loops which all increment a shared counter. Which of the following is the most appropriate mechanism to share the counter between the loops?
a. A queue with a 32-bit integer data type.
b. A functional global with operations to get the current value of the counter and set a new value for the counter.
c. A global variable
d. A functional global variable with operations to get the current value of the counter and increment the value of the counter.
To tell the truth, I do not know what the question (You have multiple acquisition loops which all increment a shared counter) means. Who can show me some examples to help me understand it better.
07-08-2019 07:50 AM
See this article for exactly what this is discussing: A Look At Race Conditions