This project has moved. For the latest updates, please go here.

How does openPDC ensure the Measurement is thread safe?

Developer
Aug 28, 2013 at 1:50 AM
Recently ,I read source about the openPDC .
I find the Measurements is transfered into Actionadapter and Outputadapter at the same time after Inputadapter collected the Measurements.
But The Measurements just transfer a part Reference(hand).The Measurements is not thead safe when Many of Threads access it.
I think,If Using "lock",Other threads will wait it and the performance will lose good.
How does openPDC ensure The Measurement is thread safe efficiently? Concurrent collection?
Coordinator
Aug 30, 2013 at 1:48 PM
Hi zhengwen12,

In most cases, Measurements are treated as read-only objects. In these cases, thread safety is not an issue since the values will be same regardless of who reads it and when. If you have an adapter that must update the properties of a measurement, I suggest you look into our queue-and-notify feature for handling inter-adapter dependencies.

https://openpdc.codeplex.com/wikipage?title=Adapter%20Synchronization%20%28Developers%29

Stephen
Developer
Sep 2, 2013 at 10:32 AM
Thank Stepen , I have know it.