Fix deadlock in previous implementation

by only allowing new inputs if the previous one has been "acked".

I.e. if you send one diff, you don't process any more diffs until you
	receive a diff back. This is something specified in the Neil Frasier
	paper and also something needed to prevent deadlock.
This commit is contained in:
Nicholas Kariniemi 2015-08-15 18:32:25 +03:00
parent 9f32a03d04
commit 0cebe1f5ab

View file

@ -11,8 +11,10 @@ empty(patch) = patch == 0
CLIENT(i, state, shadow) =
input!i?new_state
-> up!i!diff(shadow, new_state)
-> CLIENT(i, new_state, shadow)
[] down!i?patch
-> CLIENT'(i, state, shadow)
[] CLIENT'(i, state, shadow)
CLIENT'(i, state, shadow) = down!i?patch
-> if empty(patch)
then CLIENT(i, state, state)
else
@ -25,6 +27,8 @@ CLIENT(i, state, shadow) =
render!i!apply(state, patch)
-> CLIENT(i, apply(state, patch), apply(shadow, patch))
SERVER(i, shadow) =
up!i?patch
-> save!i!patch