Subject: Re: Streams Multiplexor
From: David Laight <firstname.lastname@example.org>
Date: 09/20/2002 15:34:26
On Fri, Sep 20, 2002 at 07:44:13PM +0530, Muthu Kumar L wrote:
> 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!
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
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 Laight: email@example.com