On Tuesday, April 5, 2011 1:19:04 PM UTC-4, Jonathan Lundell wrote: 
>
> On Apr 5, 2011, at 9:55 AM, Anthony wrote:
> > Yes, that's a race condition with writing. My point was that even if the 
> first action is merely reading (but not doing any writing), you can have 
> problems. For example:
> >  
> > Action 1: read session
> > Action 2: read session
> > Action 2: write session
> > Action 1: make some decision/calculation based on session data that is no 
> longer up to date
> > 
>
> Actually, I don't see that sequence as a real problem, because the result 
> is identical to this sequence: 
>
> Action 1: read session
> Action 1: make some decision/calculation based on session data that 
> predates write-2
> Action 2: read session
> Action 2: write session 
>
> That is, action 1 shouldn't rely on the timing of action 2. If only one of 
> the actions is writing, then they both have a consistent view of the 
> session.
>
I'm saying Action 1 might depend on having up-to-date session data in order 
to return a correct result, so Action 1 might want to prevent Action 2 from 
happening until Action 1 is complete. In other words, Action 1 may need to 
assume that no additional Action 2's are happening in between the time it 
reads the session and the time it renders its result. Granted, probably not 
a common problem, and probably not as big a deal as a race condition on 
writing.

Reply via email to