On Friday 26 February 2010, Andrew Johnson wrote:
> On Thursday 25 February 2010 17:20:28 Benjamin Franksen wrote:
> > I absolutely agree. It's just that in this case the language forces me
> > to use shared variables instead of message passing *even though the
> > underlying mechanism of synchronization is basically message oriented*.
>
> Could you not have used an event flag or two to communicate start/done
> events between your state sets? If you want to publish whether the
> slave is busy or not as a PV it can maintain that itself, but that
> shouldn't be the mechanism used to control it. If the slave can accept
> multiple commands it could wait on more than one flag, or read a shared
> command variable after the command event flag goes off.
Right. This is what I do now.
> > My particular problem was directly caused by the (forced) separation
> > (via global shared variables) between the synchonization (monitor
> > event, pvPut) and access to the value transported. This is something
> > that has bugged me ever since I learned about SNL. And it could be
> > fixed by making a number of language-level changes (the underlying
> > implementation of the sequencer and the generated C-code could remain
> > almost the same):
> >
> > o Allow variables local to a state or a state-set. Forbid or at least
> > discourage global variables. (Global constants are of course fine
> > and declaring them should be more directly supported.)
> >
> > o All communication between state-sets should be via PVs or event
> > flags (what was the reason, again, not to call them semaphores?) which
> > both may be declared at the top-level. One would need some sort of pv
> > or channel data type that gets bound to a PV (at the top-level or local
> > to a state set) in a way similar to the current 'assign..to' clause.
> >
> > o Allow access (write or read) to a PV object only with a procedure
> > call that gets resp. returns a value; events from monitored PVs store
> > their payload into a local variable that must be explicitly bound in
> > the state declaration.
>
> The state notation compiler and sequencer is no longer a bundled part of
> Base, so it could (and probably should) be gradually replaced by
> something better (preferably with a compiler/translator that doesn't use
> a lex/yacc parser written in C). I would definitely encourage that kind
> of development...
Cool. I'll ask my employer if they would fund this work (I don't think the
chances are great though).
Cheers
Ben
--
"...And you know what incurable diseases do: they invite the quacks and
charlatans in, who in this case take the form of Software Engineering
gurus." (Dijkstra, EWD1305)
- References:
- Re: Sequencer bug? Benjamin Franksen
- Re: Fwd: Sequencer bug? Benjamin Franksen
- Re: Fwd: Sequencer bug? Andrew Johnson
- Navigate by Date:
- Prev:
Re: Fwd: Sequencer bug? Andrew Johnson
- Next:
EPICS Codeathon before the ITER meeting Andrew Johnson
- 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: Fwd: Sequencer bug? Andrew Johnson
- Next:
caml Patrick Thomas
- 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
|