The Software Clock
Ivor Page

Soon after arriving back at the university, I was introduced to Margery, a very difficult and angry lady from Guyana. She was a Ph.D. student, supposedly working with departmental chairman, Pointclaire, but actually working completely alone, largely because he was afraid of her. Margery and I chose to be generously indifferent to each other. We managed to share time on the computer without getting in each other's way very much, and at least two years passed before I discovered what she was trying to do.

Margery had set out to write an operating system, not of itself a novel accomplishment at that time, but there was certainly plenty of room for breakthroughs in the design of various parts of such a system. When I learned that it was to support multi-programming, my interest piqued, since there was no real-time clock on the computer. The clock is needed in order to cause the operating system to switch between the users' programs. Otherwise, one program could gain control of the processor and block all others from ever making progress.

I asked Margery about the need for a clock, and she replied that hers was implemented in software. Unfortunately there was no doubt in my mind that a software clock could not perform the required task. I explained the dilemma to Pointclaire, who suggested that she might have done something truly clever and perhaps I was wrong. This was quite a shock. I thought I had just proven quite conclusively to this revered expert that his student didn't have a clue, but here he was defending her. Perhaps the revered expert was a little too revered. The important point was that my expertise was being called into question. I proposed an experiment in which Margery would run two programs under her operating system. One would print out the time every few seconds on a teletype, while the other program, mine, would perform some unspecified calculations. If she was right, her clock program would keep good time.

My program consisted of a simple loop within a loop. The inner loop counted up to a value which was set by the outer loop, then it printed a character on the printer. The outer loop gradually increased the number of iterations of the inner loop. Each time my program printed a character, it gave up control to Margery's clock program for a fraction of a second.

The fateful day of the trial came and several of the faculty, including Pointclaire, and his second in command, Max Reed, had gathered for the sport, having heard that a showdown was about to take place. Whatever the outcome, it would surely be great fun since Margery was involved. Someone would feel the cutting edge of her wrath before the day was out.

The programs were started and Margery's clock did a pretty good job for about 3 minutes. I had carefully arranged the behavior of my program to allow three minutes of almost no impact before it gradually took a more and more significant fraction of the processor's time in between allowing her program to run. By this time, most observers were trying to change their bets in favor of Margery, and Pointclaire was trying to tell me that he had told me so. Ever so slowly at first, it became evident that the clock program was slowing down. After five minutes, it was 30 seconds behind and progressing at only one half normal speed.

In a last ditch attempt to confuse the issue, Margery objected to the fact that my program printed characters. While I failed to see the logic behind this, I edited the program so that it sent null characters and we reran the experiment. We all slowly left the room, money changing hands, while a broken woman stood silently looking at the computer not understanding why life had struck her such a dreadful blow. I thought that would be the end of Margery, but I was wrong. Within the following two weeks she wrote her Ph.D. dissertation and presented it for examination. Pointclaire sent it to a friend, the chair of a computer science department at another university, who refused to read beyond the first chapter.

Each chapter began with a quote from Mine Kampf, probably not a wise choice considering the legacy of the book's author. The computer science content was rubbish. It turned out that Margery's error in the clock program stemmed from the fact that she thought each running program in a multi-programming system had its own processor. She had not grasped the basic idea of processor scheduling. Margery appealed the decision to fail her and the department had to submit the names of 10 prospective external examiners. The president picked one from a hat, and Margery's dissertation was on its way to its second victim. This extremely eminent man was largely responsible for the design of the operating system of the Atlas computer at Manchester University. He said, in Northern tones of extreme disgust, that the dissertation was, "An insult to an intelligent mind," and told the university never to send him another one.

We all thought that Margery's story had finally come to an end, and she did in fact start packing, but within her last week at the university, three of us felt her wrath in very strange ways. We probably should have asked more questions months earlier when we saw chicken bones stuck in the dirt next to her plants. Pointclaire had inquired about the efficacy of the treatment when he had inadvertently left his pet office plant sans its liquid diet through one of his summer sojourns in the United States. Margery had revived the plant within a couple of weeks with the aid of a few bones. I was the first to be jolted.

I was on a plane about to leave Heathrow for Edinburgh, when the plane abandoned its take-off and returned to the gate. The pilot announced in typical Biggles banter that he had noticed a spot of bother with one of the engines as we were about to rotate and he thought that he had better have the chaps in maintenance take a look at it. It gave me little pleasure to consider that at 100 miles per hour, just before releasing our precious clutch on terra firma, a warning alarm had sounded and the pilot had been forced to make a rather hasty choice between taking off and trying to solve the engine problem without the aid of important details, such as the ground and a team of well trained mechanics, and testing the brakes against the rapidly decreasing amount of runway ahead of us.

It was certainly a troubling moment, but no harm was done. The following night, Pointclaire was awakened by the noise of his huge Pyrenean, fighting with a neighbor's dog. He ran down stairs and out into the night to try to pull the beasts apart before the neighbor's dog was totally mauled. The fight was too much for him and he fell amongst the flying fur. His wife awoke at this time and, seeing the fray beneath her bedroom window, threw a bucket of cold water over the snarling ensemble. The shock of being hit by a gallon of high velocity cold water caused the larger dog to bite right through the most convenient piece of flesh he could find, before departing for dryer climes. The next morning, Pointclaire's right foot was encased in the largest comic style bandage I have ever seen. The same day, Reed, fell down the stairs and fractured an ankle.

Once Margery got on her plane and left for home, the disasters stopped, thus proving that the inverse square law applies even to black magic.