code: private void ensureBufferAvailability(Task task) throws InsufficientResourcesException {
  		Environment env = task.getEnvironment();
  
  		int numBuffers = this.globalBufferPool.numBuffers();
  		// existing channels + channels of the task
  		int numChannels = this.channels.size() + env.getNumberOfOutputChannels() + env.getNumberOfInputChannels();
  
  		// need at least one buffer per channel
  		if (numBuffers / numChannels < 1) {
  			String msg = String.format("%s has not enough buffers to safely execute %s (%d buffers missing)",
  					this.connectionInfo.hostname(), env.getTaskName(), numChannels - numBuffers);
  
  			throw new InsufficientResourcesException(msg);
  		}
  	}
docs: Ensures that the channel manager has enough buffers to execute the given task.
  <p>
  If there is less than one buffer per channel available, an InsufficientResourcesException will be thrown,
  because of possible deadlocks. With more then one buffer per channel, deadlock-freedom is guaranteed.
  
  @param task task to be executed
  @throws InsufficientResourcesException thrown if not enough buffers available to execute the task