What should you add to the application?

You develop a data collection application that has two threads. One thread collects data and stores it in a buffer. A second thread processes the data from the buffer. You need to ensure that only one thread can modify the buffer at a time. What should you add to the application?

You develop a data collection application that has two threads. One thread collects data and stores it in a buffer. A second thread processes the data from the buffer. You need to ensure that only one thread can modify the buffer at a time. What should you add to the application?

A.
a critical section

B.
a call to the Sleep function

C.
a call to the VirtualProtect function

D.
virtual page protection



Leave a Reply 0

Your email address will not be published. Required fields are marked *