Certification

cancel
Showing results for 
Search instead for 
Did you mean: 

CLD-R Exam 1,Question 2

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.

0 Kudos
Message 1 of 2
(3,196 Views)

See this article for exactly what this is discussing: A Look At Race Conditions


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 2
(3,194 Views)