Last active
August 8, 2016 17:11
-
-
Save wilcoxjay/efe434efcad2c71faf8b895b00cf73fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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