Skip to content

Draft: create one threading.Lock per attribute

Mateusz C requested to merge 573-no-sync into develop

Closes #573 (closed)

A proposition to solve a problem with parallel read_attributes and push_change_events calls discussed in the above ticket.

It introduces a new kind of Lock attribute_lock available for each PyTango Device attribute.

Few things to consider:

  • Should this lock also protect non-green read/write methods?
  • will this work for all green modes?
  • should we use it to protect isallowed also? (I think its not needed because its not working on the underlying Tango::Attribute attr object)
  • should we document it somehow?
  • isn't my solution getting in the way of main asyncio concept?... for example in case a user wants to read the same attribute multiple times in parallel it's not going to be possible. Maybe we should make this lock optional then?

Side note - Usage of set_user_attr_mutex proposed by Reynald would probably require some work in boost layer, so I didn't investigate it so much, because I wanted to try this approach more simple to me.

Edited by Mateusz C

Merge request reports