Hi Everyone
until now I have tried hard to avoid breaking existing SNL programs when
developing new features or cleaning up the code base. I cannot claim
that I succeeded completely, but I got the impression that the
transition from 2.0 to 2.1 went reasonably well for most people.
I am planning to make some changes for version 2.2 that can break
existing programs if they rely on certain mis-features that I inherited
from earlier versions.
One of these is the behaviour of pvPut and pvGet with multi-PV arrays.
Concretely, assume a declaration
int x[2];
assign x to { "pv1", "pv1" };
and an action statement
pvGet(x);
Currently this is equivalent to
pvGet(x[0]);
I find this quite un-intuitive and arbitrary. My current plan is to
change the behaviour so that if an array has been assigned to multiple
PVs, the pv functions should act on *all* elements, instead of only the
first.
You might think at first that this is unnecessary, why not implement the
behaviour with a simple loop:
for(i=0; i<2; i++)
pvGet(x[i]);
But this would have far greater latency than necessary, since it issues
one request, waits for the response, then issues the next request, waits
again, etc. An implementation in the runtime system could easily issue
all requests up front, then simultaneously wait for the responses. If
you want to do this in SNL code, it would have to look like
for(i=0; i<2; i++)
pvGet(x[i],ASYNC);
/* ... switch to a new state, then:*/
when (pvGetComplete(x[0]) && pvGetComplete(x[1])) {
/* continue ... */
}
which is no longer a simple loop; the code would become quite unwieldy,
especially with more array elements.
An alternative would be to instead disallow pvGet(x) for multi-PV arrays
(the compiler can detect this statically). This would mean you *have* to
say
pvGet(x[0]);
if that is what you want to happen. I could then add new functions
(pvGets? pvGetMultiple? pvGetMany? pvGetArray?) that will behave in the
new way.
Similar considerations apply to other pv functions. As a side-note,
pvPutComplete (but *not* pvGetComplete) already supports multi-PV arrays
in a sensible way.
Comments or suggestions, especially from "sequencer power users" would
be very much appreciated.
Cheers
Ben
--
"Make it so they have to reboot after every typo." -- Scott Adams
Attachment:
signature.asc
Description: This is a digitally signed message part.
- Replies:
- Re: A question regarding sequencer compatibility Benjamin Franksen
- Navigate by Date:
- Prev:
Re: procServ and sseq Pierrick Hanlet
- Next:
Re: Strange warning from asSetFilename Michael Abbott
- 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: procServ and sseq Pierrick Hanlet
- Next:
Re: A question regarding sequencer compatibility Benjamin Franksen
- 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
|