On Fri, Dec 29 2017, Jameson Graef Rollins <[email protected]> wrote:
> The peculiar thing I'm worried about is that in my current application
> there are, under some circumstances, multiple record updates during a
> single driver.write(). For example, before pcaspy 0.7.0, I was doing
> something like this:
>
> class MyDriver(pcaspy.Driver):
> ...
> def write(self, channel, value):
> ...
> self.setParam(channel, value)
> self.setParam(other_channel, other_value)
> ...
> self.pvDB[channel].flag = False
> self.updatePVs()
> return True
>
> The 'pvDB[channel].flag = False' was to prevent subscribed clients from
> seeing multiple updates for the primary record 'channel'. In 0.7.0, it
> seems that neither that, nor the final updatePVs() call are necessary.
> However, I am now occasionally (less than 50% of the time) seeing
> multiple client updates for the primary channel. The sporadic nature of
> the double updates makes me think there's some kind of race condition.
> Regardless, I can't figure out what's going on, and how to uniformly
> prevent redundant update in subscribed clients.
Xiaoqiang, I just sent a pull request for a patch that seems to fix this
issue for me [0]:
https://github.com/paulscherrerinstitute/pcaspy/pull/49
There is a race condition between the SimplePV.updateValue() calls in
the PV scan() method, and in the Driver.updatePV() method. The above
patch is a work around for the issue and seems to eliminate the
occasional double updates that I was seeing in my test suite.
This does *not* fix the other issue that I mention in the other thread,
that I see spurious updates after initialization.
jamie.
Attachment:
signature.asc
Description: PGP signature
- References:
- usage of updatePVs in pcaspy Jameson Graef Rollins
- Navigate by Date:
- Prev:
Re: usage of updatePVs in pcaspy Jameson Graef Rollins
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
<2017>
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: usage of updatePVs in pcaspy Jameson Graef Rollins
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
<2017>
2018
2019
2020
2021
2022
2023
2024
|