XON/XOFF buffer control

Conor P. Cahill cpcahil at virtech.uucp
Thu Nov 30 12:42:42 AEST 1989


In article <1928 at eric.mpr.ca>, parker at zaphod.mpr.ca (Ross Parker) writes:
> 	Does anyone know how flow control is handled in the
> tty driver in the case where an external device is not able
> to halt output immediately upon receiving an XOFF, i.e. it
> must send 'a few' characters after getting the XOFF?

Anyone inplementing a flow control mechanism must allow for additional
data to come in following a "turn off".  This must be the case because
as a minimum the following delays will occur:

	1. propagation time from sender for byte that "broke the camels back"
	2. Time to process the byte & determine that threshold has been 
	   reached (this will usually be near 0 when compared to the propagation
	   times).
	3. propagation time for the discontinue signal (XOFF in this case) to
	   be sent back.

The communications handler must be able to handle this case.  Usually the
threshold is set to a certain percentage like 

	at 80% full send XOFF  to turn off data flow
	at 50% full send XON   to turn it back on

The handler should also adjust the percentage depending upon the data rate (
a higher percentage, like 90%, could be used for a 1200 baud rate, while
at 56Kb, the handler may need to use a 40 or 50% threshold.)

> How much room is left in the input buffer?

This depends upon the implementation.


-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.unix.questions mailing list