Subject: Re: Streams Multiplexor
To: <>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 09/20/2002 15:34:26
On Fri, Sep 20, 2002 at 07:44:13PM +0530, Muthu Kumar L wrote:
> Hi,
> 
> 	Is there a way to avoid starvation in a streams based multiplexor.
> I have the following scenario:
> 	I have 'n' upstreams and 1 downstream in the multiplexor. The
> multiplexor multiplexes data from  downstream to one of the 'n'
> upstreams. Suppose one of the upstreams becomes full, the flow control
> eventually propagates to the multiplexor and the remaining (n-1) upstreams
> are put to starvation even if their queues are not full.  Is there any way
> to solve this problem.

Not a very netbsd question!

However...

It does depend on what your (de)mux is actually doing / processing.
If it is a protocol stack (like TCP) then it can tell the far end
to stop sending - so there will be a finite amount of excess data.
If it is connectionless then data can be discarded.

One thing to remember is that you can exceed the high water mark.
So you don't need to hold the data yourself when the upstream Q
is full.

Also if the Q is full, assume it will be emptied 'soon', so don't
remove credit (close the window) immediately.  Just avoid sending
extra credit.  (Unless your system is in buffer crisis.)


	David

-- 
David Laight: david@l8s.co.uk