[comp.unix.aux] Keeping up with 19200 baud

urlichs@smurf.ira.uka.de (Matthias Urlichs) (11/18/89)

I have the following problem with my Macintosh II, running A/UX 1.0 (S5R2):

When receiving 19200 baud data with uucp-g, the speed is OK at first. Then
things start to deteriorate; it seems that uucico doesn't get processor time
when its read is complete but some time afterwards (about 1/5 to 1/10 second).
As soon as I start a disk-intensive job, uucico's speed goes up, then down
again a few seconds after the disk intensive job is completed. (I used
find / -name vgztw ;-) 

nice(-20) doesn't do anything except that the speed drops off somewhat slower.
ps shows a NICE of zero (obviously) and PRI goes up to 70 rather fast.
It also shows a C parameter of 10.
This seems to indicate that the scheduler thinks my uucico is CPU-bound when
in reality it is emphatically not. (Sending goes ahead at full speed which I
can't explain because it should not make a difference to the scheduler
whether I send a block of 64 bytes and read one of five, or the other way
round).

What can I do?
Can I (comp.unix.questions question) access the kernel's process structure in
kernel memory and set the PRI and/or C values back to something "reasonable"?
Any sample code to access the proc table which actually works? :-)

Or (comp.unix.aux question) is that problem fixed in A/UX 1.1?

aTdHvAnKcSe
-- Matthias Urlichs, urlichs@smurf.ira.uka.de

alexis@panix.UUCP (Alexis Rosen) (11/28/89)

This is not my field of expertise, but I believe that the Mac's built-in
serial ports can't begin to cope with 19.2kbps because they get an interrupt
for every byte. If so, either your statistics are wrong, or you're using a
serial card.

So: Am I wrong? If not, are you? If not, what card are you using?

Alexis Rosen
alexis@rascal.ics.utexas.edu

chris@mimsy.umd.edu (Chris Torek) (11/29/89)

In article <568@panix.UUCP> alexis@panix.UUCP (Alexis Rosen) writes:
>This is not my field of expertise, but I believe that the Mac's built-in
>serial ports can't begin to cope with 19.2kbps because they get an interrupt
>for every byte.

It is possible to keep up with 1920 characters per second even with one
interrupt per character, *provided* that the interrupt handler is carefully
hand-coded, or the CPU is extremely fast.  The average 68010 with the
average sloppy `do a few thousand instructions' style interrupt handler
will not keep up.  A somewhat slow 68020 Unix box (the Sun 3/50) with
a reasonably good interrupt handler (i.e., not SunOS 4.x) will, although
it will use most of the CPU.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

sl@van-bc.UUCP (Stuart Lynne) (11/29/89)

In article <568@panix.UUCP> alexis@panix.UUCP (Alexis Rosen) writes:
>
>This is not my field of expertise, but I believe that the Mac's built-in
>serial ports can't begin to cope with 19.2kbps because they get an interrupt
>for every byte. If so, either your statistics are wrong, or you're using a
>serial card.
>
>So: Am I wrong? If not, are you? If not, what card are you using?
>

The Mac's serial ports work fine for keeping up with 19.2kbps. Most terminal
emulators have some problems do to screen updates etc. Using appropriate
load shedding techniques you can fairly easily have a terminal emulator that 
keeps up to 19.2kbps without flow control. I have a desk accessory that does it.
Worked well on a 128kb Mac, was only about 8kb in size, and was written in C
(well with some inline's).

Basically you need to setup a large FIFO buffer for serial data, get in
large chunks vs. one char per call, only update screen display for every few
lines ... just your basic optimizing techniques. 

Another data point, Appletalk (or whatever they are calling it these day's)
run's at 240(?)kbps without problems.


-- 
Stuart.Lynne@wimsey.bc.ca ubc-cs!van-bc!sl 604-937-7532(voice) 604-939-4768(fax)

joej@oakhill.UUCP (Joe Jelemensky) (11/29/89)

In article <568@panix.UUCP> alexis@panix.UUCP (Alexis Rosen) writes:
>
>This is not my field of expertise, but I believe that the Mac's built-in
>serial ports can't begin to cope with 19.2kbps because they get an interrupt
>for every byte. If so, either your statistics are wrong, or you're using a
>serial card.

My Mac IIx's built in serial port (phone port) is connected to a SUN
workstation serial port and I've been running at 19200 for a looong time.
I haven't noticed any problems using Mac II as a terminal or for
upload/dwnloads.

cander@unisoft.UUCP (Charles Anderson) (11/30/89)

From article <74@van-bc.UUCP>, by sl@van-bc.UUCP (Stuart Lynne):
> 
> Another data point, Appletalk (or whatever they are calling it these day's)
> run's at 240(?)kbps without problems.

I'm not sure how they (Apple) are doing it under A/UX 1.1.1, but MacOS
uses polled I/O to do LocalTalk at 240 Kbps.  This saves the interrupt
per character/100's of instructions overhead at the cost of essentially
shutting the machine down during transfers.  I believe this is the
reason that LocalTalk was not supported earlier using the motherboard
serial ports.  The hot ticket would have been if Apple had utilized the
DMA capabilities of the SCC chip, but alas...

-- 

Charles.
{sun, ucbvax, pyramid, uunet}!unisoft!cander