Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(96)

Issue 1018001: code review 1018001: kit/rh/ripple: fix mutex implementation to work properly

Can't Edit
Can't Publish+Mail
Start Review
Created:
3 years, 9 months ago by chris
Modified:
3 years, 8 months ago
Reviewers:
petar
CC:
gocircuit-dev_googlegroups.com, petar
Visibility:
Public.

Description

kit/rh/ripple: fix mutex implementation to work properly

The previous mutex implementation had issues with resets, interupted
waiters, and a number of other things. This is a completely new
implementation that is simpler to follow and reason about. It uses Go's
own scheduler instead of inventing a new one.

It behaves cleanly when a reset occurs underneath waiting processes,
handles processes that interrupt themselves in the middle of "Open",
and always gets the stats right.

The semantics of locking are clearer, now, as well. A token is passed
to a lock on Open, and that token is assumed to be held until Clunk (or
reset). A lock FID simply tests that it still has the token when it
wants to read or write.

Patch Set 1 #

Patch Set 2 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 3 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 4 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 5 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 6 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 7 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 8 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 9 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 10 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 11 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 12 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 13 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 14 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 15 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 16 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 17 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 18 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Total comments: 2

Patch Set 19 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 20 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 21 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 22 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 23 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 24 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 25 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 26 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 27 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Patch Set 28 : diff -r 64e9bd769d59 https://code.google.com/p/gocircuit/ #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
A src/circuit/kit/rh/ripple/endpointdir.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +262 lines, -0 lines 0 comments Download
M src/circuit/kit/rh/ripple/lock.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 3 chunks +34 lines, -48 lines 0 comments Download
M src/circuit/kit/rh/ripple/mutex.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +9 lines, -8 lines 0 comments Download
R src/circuit/kit/rh/ripple/semaphore.go View 1 2 3 4 5 6 1 chunk +0 lines, -197 lines 0 comments Download
M src/circuit/kit/rh/ripple/util.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +11 lines, -0 lines 0 comments Download
A src/circuit/kit/rh/tokenlock/tokenlock.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +323 lines, -0 lines 0 comments Download
A src/circuit/kit/rh/tokenlock/tokenlock_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +157 lines, -0 lines 0 comments Download

Messages

Total messages: 10
chris
Hello p@gocircuit.org, petar (cc: gocircuit-dev@googlegroups.com, p@gocircuit.org), I'd like you to review this change to https://code.google.com/p/gocircuit/
3 years, 9 months ago #1
chris
I just realized that I had some debug statements in there. I removed them and ...
3 years, 9 months ago #2
chris
Test of group posting (just joined). On Tue, Jan 21, 2014 at 4:44 PM, Chris ...
3 years, 9 months ago #3
chris
By the way, these changes apparently fix a number of issues. One was that reads ...
3 years, 9 months ago #4
chris
Note that I just redid the CL to actually be correct. The fixes I put ...
3 years, 9 months ago #5
chris
Hello p@gocircuit.org, petar (cc: gocircuit-dev@googlegroups.com, p@gocircuit.org), Please take another look.
3 years, 9 months ago #6
chris
Hello p@gocircuit.org, petar (cc: gocircuit-dev@googlegroups.com, p@gocircuit.org), Please take another look.
3 years, 8 months ago #7
petar
I have a feeling that I won't be editing much of your code :) I'm ...
3 years, 8 months ago #8
chris
Yep, it should compile just fine. On Mon, Feb 10, 2014 at 3:13 PM, <p@gocircuit.org> ...
3 years, 8 months ago #9
chris
3 years, 8 months ago #10
https://codereview-gocircuit-org.appspot.com/1018001/diff/150014/src/circuit/...
File src/circuit/kit/rh/ripple/util.go (right):

https://codereview-gocircuit-org.appspot.com/1018001/diff/150014/src/circuit/...
src/circuit/kit/rh/ripple/util.go:59: 
On 2014/02/10 20:13:19, petar wrote:
> You are brilliant! :)

I can't take credit for that idea: it came from Effective Go. But I agree: it's
brilliant.

:-)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1034:7cc4d015c6df-tainted