code: private void redistributeBuffers() {
  		if (this.localBuffersPools.isEmpty() | this.channels.size() == 0) {
  			return;
  		}
  
  		int numBuffers = this.globalBufferPool.numBuffers();
  		int numChannels = this.channels.size();
  
  		double buffersPerChannel = numBuffers / (double) numChannels;
  
  		if (buffersPerChannel < 1.0) {
  			throw new RuntimeException("System has not enough buffers to execute tasks.");
  		}
  
  		// redistribute number of designated buffers per buffer pool
  		for (LocalBufferPoolOwner bufferPool : this.localBuffersPools.values()) {
  			int numDesignatedBuffers = (int) Math.ceil(buffersPerChannel * bufferPool.getNumberOfChannels());
  			bufferPool.setDesignatedNumberOfBuffers(numDesignatedBuffers);
  		}
  	}
docs: Redistributes the buffers among the registered buffer pools. This method is called after each task registration
  and unregistration.
  <p>
  Every registered buffer pool gets buffers according to its number of channels weighted by the current buffer to
  channel ratio.