Articles

Previous entries

Multi-threaded processing

The inputs to the system were

Timer task

The task that handled the 2 ms timing interrupt would read all the channels digitized values. For each of the samples that was associated with an active call, the values would be stored in a buffer which was large enough to hold the 10 seconds for each lead set.

When the buffer was full, an interrupt would trigger the task responsible for writing the buffer to the disk. A new buffer would be attached for samples that would come next. When the call was completed, the tape write task would be signalled.

Write Buffer to Disk task

This task would issue a request to the OS to write the buffer to the disk and request an interrupt upon completion.

Call completion task

So imagine that there are 20 calls in progress, at various states of completion. The buffers are written to disk in order of completion, not in order of the telephone lines.

This task writes the data from a completed call to tape. Since the buffers are written to disk effectively in a scattered order, this task must write all the buffers associated with one call to tape. The data is prefixed with a header containing patient ID, hosptial ID, and some time information.

Once the tape is full, it would be rewound and the operators would mount a new tape. The operator would transfer the tape to the Analysis system for processing.

Tape writing task

Records would be written to tape more-or-less in parallel with writing to disk. At first, records were written as the buffer was filled. Later, complete records for one call would be pulled from the disk and written contigously to tape.

Tape formats

As the system evolved, the use of the 9-track tape changed. In the beginning, it was seen as a failsafe backup in case of power failure, in addition to way to get the data to the Analysis system. A record would be written to tape signalling the end of the call.

Once the Collection and Analysis processes were combined into one system, the tape format evolved to a more archival form, with the data for one call written contiguously.

Transferring the tape to the Analysis system

Once the operator mounted the tape, they would trigger the Analysis program to read the tape and perform the Analysis. The result would be punched on paper tape which would be carried over the row of teletype machines to send out.

There was a clever way to identify the hospital to send the report to. The hospital ID would be punched on the tape in visual form with a visual separator between reports. At the teletype, there were dialout cards that would feed into a mechanical dialer. Once the remote printer answered, the operator would start the paper tape feed.

Combining the systems

We spent significant engineering resources to combine Collection and Analysis into one system. This enabled the developers to work during the daytime.

The distribution system

The next development was to eliminate the paper tape. This required creating a new system called "Distribution" software to send the report out over lines that the computer could dial automatically. The bulk of this work was done by Michael Whinihan. Partly as a result of our use of coroutines, there were zero multi-thread errors, and only one single-thread error.

My advice to you youngsters that if you ever get a chance to work with someone whose high school paper Fibinicci Nim (1963) earns a note in Donald Knuth's The Art of Computer Programming, I recommend taking advantage of the opportunity. Mike is one of the smartest people I know.

I helped review the design of the system. We worked together on the design of coroutines for our inter-task coordination. See the next article Coroutimes for intertask coordination

The Distribution system shortened out delivery to 10 minutes, from the time the ECG phone call finished till the time the hospital's printer began printing the report.

Recent entries