Hi Dirk
On Friday 21 May 2010, Dirk Zimoch wrote:
> Locking and/or re-reading might be possible for SNL code accessing the
> variables but what about escaped C-Code? You probably have to take the
> lock before escaping to C but then nobody is allowed to do blocking
> things in that code.
>
> A layer of "shadow variables" might be safe. CA updates the shadow copy
> at any time while the state code executes. Only during the state
> transition and inside pvGet the data is transfered to the "user copy".
> (any back inside pvPut). CA has to be locked out only during these copy
> actions. Of course that requires twice the amount of memory for
> variables plus some time for the additional copy.
Yes. I came to the same conclusion when discussing this with GÃtz. I think
the additional overhead is the price to pay for correctness.
> Concerning double: On the new PPC 500v2 core it takes indeed two
> assembler instructions to load or store a double. Thus doubles are
> non-atomic.
Ah, thanks for a definite statement.
> By the way, I think arrays are already unsafe on the server!
Ouch!
> If the
> array record processes and updates the array at the same time as it is
> sent on the network by CA, the user gets a half old/hald new array. This
> is because only the pointer to the array is put into the queue for the
> CA thread, not the array data itself. (I am happy if somebody could
> prove me wrong.)
Hm, you could try to prove that it happens. This may be difficult, though.
Anyway, thanks for your input!
Cheers
Ben
- Replies:
- RE: Race conditions in SNL programs Mark Rivers
- References:
- Race conditions in SNL programs Benjamin Franksen
- Re: Race conditions in SNL programs Benjamin Franksen
- Re: Race conditions in SNL programs Dirk Zimoch
- Navigate by Date:
- Prev:
Re: Race conditions in SNL programs Dirk Zimoch
- Next:
RE: Race conditions in SNL programs Mark Rivers
- 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: Race conditions in SNL programs Dirk Zimoch
- Next:
RE: Race conditions in SNL programs Mark Rivers
- 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
|