Want do improve performance of /dev/tty?? drivers
Bill Burton
billb at amcad.UUCP
Sat Feb 13 17:17:05 AEST 1988
I am working on an application that talks to several devices on an
rs-232 line at 1200 baud. Each device is polled by sending it a
sequence that only it will recognize. The device responds whether there
is any data waiting or not. These data packets are no more than about
30 bytes in length.
This C program is run from the Progress database using the input-output
statement which forks and execs the C program redirecting input and
output of the program to the database program.
I would like to increase the number of devices on each line from four to
about eight or ten. Currently, if more than four devices are on one
line, the response time is too slow.
One scheme I tried was to poll all the devices sending any requests to
the database. The idea was that after a request had been sent for the
first device, the database would be busy looking up the request while
the polling program would poll the next device. By the time the polling
program had finished with the last device on the line, the database
would have finished the lookup request for the first device on the line.
This did speed things up a bit but sometimes the output was sent to the
wrong device :-) .
The following are some ideas for improving the response times:
1. Write an interrupt driven tty driver. I don't know if this is even
applicable under Unix System V or Xenix. I'm from an MS-DOS background.
2. Write a tty driver that allowed determining if anything was waiting
in the buffer. Currenly I'm seting an alarm(1) and the port for
raw I/O. Even the one second delay if the alarm is tripped is too
costly. If I could just do an ioctl() to determine if anything is
waiting (like BSD), that would help.
3. Fix the crude scheduling mentioned above to be more intelegent (and
send the output to the correct device). Currently the C program
polls the device, sends a request to the database, waits for the
database lookup to complete, and then sends the output back to the
device, *then* the next device is polled. Where can I find out
about some scheduling algorithms?
How can I effectively measure what is going on?
o Would using the monitor() function help in determining where the
time is spent?
o Would anything be gained by hooking up some kind of data line monitor
to see what is going on? What would I look for?
Any ideas, tips, hints etc. would be very helpful.
Please e-mail your responses.
Thanks,
Bill
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Name: William D. Burton
US Mail: American Academy of Arts and Sciences
136 Irving St., Cambridge, MA 02138-1996
Audible: 1-617-576-5023
UUCP: ...!husc6!amcad!billb
ARPANET: billb%amcad.uucp at husc6.harvard.edu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
More information about the Comp.unix.wizards
mailing list