]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Improve the note about chunk writing concurrency
authorMatt Joiner <anacrolix@gmail.com>
Mon, 16 May 2016 16:12:06 +0000 (02:12 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 16 May 2016 16:12:06 +0000 (02:12 +1000)
Everytime I see memory spike I suspect this, and it isn't it.

client.go

index c92f7c2c82c9bc732b03bed91e50da6f1c31ce2b..44298663c1d094d65903557756b8512239cf58e0 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1816,7 +1816,8 @@ func (cl *Client) downloadedChunk(t *Torrent, c *connection, msg *pp.Message) {
        }
 
        cl.mu.Unlock()
-       // Write the chunk out.
+       // Write the chunk out. Note that the upper bound on chunk writing
+       // concurrency will be the number of connections.
        err := t.writeChunk(int(msg.Index), int64(msg.Begin), msg.Piece)
        cl.mu.Lock()