Expert C Programming

(Jeff_L) #1

int row_2[] = {6,7,-1};


int row_3[] = {8,9,10,-1};


int *weights[] = {


row_1,


row_2,


row_3


};


More about this in the next chapter, on pointers. But first, a little light relief.


Some Light Relief—Hardware/Software Trade-Offs


To be a successful programmer, you have to have a good understanding of the software/hardware
trade-offs. Here's an example that I heard from a friend of a friend. Many years ago there was a large
mail order company which used an old IBM legacy mainframe to maintain their names and addresses
database. This machine had no batch control mechanism at all.


The IBM system was obsolete, and was due to be replaced by a Burroughs system. That shows you
how long ago it was—Burroughs (or "Rubs-rough" as we anagramatically adapted it) hasn't existed
since the mid 1980's when it merged with Sperry to produce Unisys. Meanwhile, back at the data
processing ranch, the IBM was running at full capacity, including a night shift. The sole task of the
night operator was to wait until the day jobs finished, then start up four more jobs at intervals
throughout the night.


The data processing manager realized that he could free up the night operator to work on the day shift
if he could find a way to start batch jobs at certain times. IBM quoted a figure in the tens of thousands
of dollars for the software upgrade to provide this. Nobody wanted to spend that much on a machine
that was soon to be decommissioned. It so happened that the machine was divided into several
partitions, each with an attached terminal. It was possible to arrange the night jobs so that each one
was initiated from a different terminal. Each terminal could be set up so that the job would start as
soon as the return key was pressed. The manager then designed and built four copies of a device he
called the "phantom finger," illustrated in Figure 9-10.


Figure 9-10. The Phantom Finger

Each night a phantom finger was set up behind each terminal. At 2 a.m., the first alarm would go off.
The winder on the alarm wound up the thread, pulling out a pin, which caused the arm to drop onto
the return key. The Lego brick snapped off, avoiding key bounce or repetition, and the job started.


Although everyone laughed at this contraption, it worked for six months until the new system was in
place! Within hours of the new system being commissioned, systems engineers from both Burroughs
and IBM were begging for a surviving example of these Rube Goldberg devices. And that is the
essence of a successful software-hardware trade-off.

Free download pdf