90 likes | 203 Views
PV Manager. Gabriele Carcassi Feb 18 2010. Objective. To address the mismatch between the requirements of GUI subsystems and the CA client libraries. UI subsystem requirements. Single threaded Notification must be done on event thread
E N D
PV Manager Gabriele Carcassi Feb 18 2010
Objective • To address the mismatch between the requirements of GUI subsystems and the CA client libraries
UI subsystem requirements • Single threaded • Notification must be done on event thread • Data objects must be changed on the event thread only (to simplify responding to events) • Work must be offloaded to other threads as much as possible (to prevent unresponsiveness) • Refresh rate 1Hz-50Hz (faster is useless and counter productive)
Channel Access • Multi threaded • Notification done on connection threads • Data objects changed on connection threads • Rate is not limited: can be KHz
Collect, aggregate and notify Notificator Collector Monitor • Need to collect the data at the line rate • Aggregate the data at the UI rate, and notify on UI thread • Decide how to aggregate (avg, last value, min, max)
Transform and calculate Notificator Collector Monitor • While we are on other thread, we might as well calculate what we need • Define functions of multiple PVs, that may transform types (calculate statistics, prepare synch’ed arrays, …) PV Function PV Function Cache
Close channels Notificator Collector Monitor • We can use the GC to detect end of use • If PV object is GCed, notification can stop • If Collector is GCed, CA monitors can stop PV Function PV Function Cache
Locks Notificator Collector Monitor • Collector holds (is) write lock for line rate access • Collector holds read lock for its data (buffer) • Notificator is lock for calculating and notifying PV Function PV Function Cache