Branch: refs/heads/master
  Home:   https://github.com/conformal/btcd
  Commit: d3a7f15a87ec3ff199a90d010f98d21e13d316ae
      
https://github.com/conformal/btcd/commit/d3a7f15a87ec3ff199a90d010f98d21e13d316ae
  Author: Owain G. Ainsworth <[email protected]>
  Date:   2013-12-23 (Mon, 23 Dec 2013)

  Changed paths:
    M peer.go

  Log Message:
  -----------
  Alter the way peers queue outbound messages somewhat.

Instead of one thread that queues and writes, we move to a two queue
model. The queueHandler muxes all the sources of outgoung packets and
drips them to the actual sender. This is done so that a large send
doesnt' allow the channels to fillup and cause blockmanager and server
to block, which delays other peers.

Most messages we handle as is. However, for getdata we do some manual
limiting and pipelining, we queue up three and then we load the next
into memory, not sending it until the otherp ackets have been sent. We
may want to change this later to queue the packet *then* wait so that we
don't completely drain the pipe.

A few misc tweaks to avoid deadlocking by ensuring the all channels will
always drain. mostly this relates to ensuring that we know no more data
will be coming before we drain the channel, and not queueing after we
are marked to disconnect.

Discussed heavily with drahn@ and davec@.


Reply via email to