ess-dmsc-dram / live-data-prototype

GNU General Public License v3.0
3 stars 1 forks source link

Locking for `Controllable` objects #23

Open SimonHeybrock opened 8 years ago

SimonHeybrock commented 8 years ago

EventGenerator reads meta data (attributes) from a base generator (which in turn can inherit from Controllable). Next, it calls get_events(), potentially several times, to obtain all events for a pulse. If meta data changes between (or within) these calls results may be off (mainly for large parameter changes).

Thus we need to lock the base generator from changes while generating data for a pulse. One option would be to put add lock() and unlock() methods to Controllable. The lock would be checked by Controllable before calling setattr.