Skip to content

Instantly share code, notes, and snippets.

@wilcoxjay
Last active August 8, 2016 17:11
Show Gist options
  • Select an option

  • Save wilcoxjay/efe434efcad2c71faf8b895b00cf73fe to your computer and use it in GitHub Desktop.

Select an option

Save wilcoxjay/efe434efcad2c71faf8b895b00cf73fe to your computer and use it in GitHub Desktop.
msg := Put(k,v) | Get(k) | Resp(v_old)
Server:
main():
db = {}
while m = recv():
v0 = db[m.k]
if m is Put:
db[m.k] = m.v
send Resp(v0) to m.src
Client:
get(k):
s = hash(k)
send Get(k) to s
Resp(v0) = recv()
return v0
put(k,v):
s = hash(k)
send Put(k,v) to s
Resp(v0) = recv()
return v0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment