> 0: v ← v - 1 [→41] write(stock, v) … commit begin … [>0] if is-true({? > 0}): f ← {? - 1} [→?-1] write(stock, f) … commit Key observation: transaction does not need to observe a concrete state to execute its logic.
> 0: v ← v - 1 [→41] write(stock, v) … commit begin … ? ← read(stock) [>0] if is-true({? > 0}): f ← {? - 1} [→?-1] write(stock, f) … commit Obtain a future that represents the stock value instead of the concrete stock value as of right now.
> 0: v ← v - 1 [→41] write(stock, v) … commit begin … ? ← read(stock) [>0] if is-true({? > 0}): f ← {? - 1} [→?-1] write(stock, f) … commit Key observation: transaction can know whether the predicate is true without observing a concrete value.
> 0: v ← v - 1 [→41] write(stock, v) … commit begin … ? ← read(stock) [>0] if is-true({? > 0}): f ← {? - 1} [→?-1] write(stock, f) … commit New operation to execute predicates over futures.
> 0: v ← v - 1 [→41] write(stock, v) … commit begin … ? ← read(stock) [>0] if is-true({? > 0}): f ← {? - 1} [→?-1] write(stock, f) … commit Key observation: transaction can specify how to compute the new value.
> 0: v ← v - 1 [→41] write(stock, v) … commit begin … ? ← read(stock) [>0] if is-true({? > 0}): f ← {? - 1} [→?-1] write(stock, f) … commit Function that computes the new value based on futures.
> 0: v ← v - 1 [→41] write(stock, v) … commit begin … ? ← read(stock) [>0] if is-true({? > 0}): f ← {? - 1} [→?-1] write(stock, f) … commit Execute f when transaction commits and ? is resolved to a concrete value.