90 likes | 216 Vues
This document addresses the critical mismatch between GUI subsystem requirements and CA client libraries. Focusing on efficient event handling, it emphasizes single-threaded design principles for UI data alterations while offloading tasks to prevent system unresponsiveness. The proposed framework supports a refresh rate of 1Hz-50Hz, allowing for multi-threaded Channel Access. It discusses data collection, aggregation, and notification strategies, and outlines the roles of various components such as Notificator, Collector, and Monitor in managing and transforming data effectively.
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