Deadlocking

comment 1
Uncategorized

A brief word of explanation: deadlock is a concept that exists in computer science (well, other places too). It occurs when two or more ‘things’ each want something — the same something — and each waits for the other to finish and as a result, neither finishes. It’s an important concept but a little subtle — not terribly so but enough that Professor R didn’t even try to explain it to the halfwit kid that took his course back in… let’s just say ‘way back when’. It’s not that hard to explain, though: examples can be found pretty much everywhere — including the end of my driveway.

Just the other day I droned on (but not on and on) about winter; in that particular piece of drivel I concentrated on a few ‘features’ of winter. In the process I gave fairly short shrift to the most obvious characteristic of winter (at least hereabouts): snow. In winter it snows. Sometimes — like this year — it snows rather a lot. When it snows a lot, life can be… messy. People forget how to drive, people shovel and have heart attacks and people develop odd attractions to brightly coloured carbon fibre.

Snow leads to several winter rituals. One of them is a sort of homeowner-snowplow tango. The steps are quite simple — the homeowner looks out the window, gauges the amount of snow in the driveway and asks questions: Does it need to be shovelled? Really? Has the snowplow been by yet? Does he have to go anywhere? Inevitably, he has to go somewhere before the plow comes so he goes outside and shovels the driveway. Sometime after he finishes, the snowplow comes by and deposits a two foot high windrow of snow across the end of the driveway. (Authorities disagree on the proper timing of this step: some claim that it should happen while the homeowner is standing there, leaning on his shovel, contemplating a job well done. Others suggest that the optimal time is just after the shoveller goes back into his house but before he comes back out to back out of the driveway and drive off.)

Besides pushing the berserk buttons of mild-mannered city dwellers, snowplows push, um, snow. (It’s kinda what they’re made for, after all.) That snow has to go somewhere so snowplows, besides creating a brisk business in local emergency rooms, also create snowbanks down both sides of every city street. With every snowfall, these get denser, higher and wider. And, as they get wider, the street — inevitably — gets narrower. Because of this, the city periodically removes snowbanks with a giant snow-eating machine and a fleet of dump trucks. (There’s a certain irony in the fact that when it’s most needed — the years with a lot of snow — they can least afford to do it.)

Another aside: Ms. Rose and I live about eight blocks from one of the local universities. Once upon a time the university charged its employees fairly modest fees for permits to park there. I don’t know the details (they’re probably complicated and full of shades of grey) but I do know that everyone likes to make money from parking so, well, things changed — these days it appears that parking permits are treated as Just Another Revenue Stream. What this means is that prices are high, there are regular increases and every time the rates are raised fewer people pay them. People that don’t pay them park… in front of our house. Combine this with wide snowbanks and narrow streets and you get… issues.

Ms. Rose and I, for a variety of reasons that I won’t go into here, maintain two cars — one red, one blue. This means that, due to poorly understood and somewhat complicated physical phenomena, the ‘wrong’ car is almost always at the back of the driveway. This means that, after shovelling the driveway and cleaning the car, the car needs to be moved, parked on the street and the other car dug out and cleaned off. On a narrow street with parked cars obstructing the end of the driveway, well, this is harder than it needs to be.

Last week, for example, I wanted access to the red car so I could go to the curling club and lose two games. (Well, I didn’t want to lose the two games — that part just happened.) I brushed snow off the blue car, scraped the frost off its windows and managed to maneuver it past a minivan that was cleverly positioned so it ‘almost’ blocked both the driveway and the road. (Sometimes it’s good to see creativity and initiative. Other times… not so much.) I parked the blue car in the last remaining open spot on the street (I was not, if I do say so myself, not as creative as the owner of the minivan had been.) and started to head back to my shovel, my brush and ‘my’ snowdrifts.

I had to stop, though: my path was blocked by an expensive big-ass car (I’m fairly sure it was a Buick Enclave). He (I didn’t actually get a good look at the driver so I’m not actually sure if it was a he or a she. I’m just assuming based on the size of his strap-on ego car and what came next.) was entering one end of the single lane obstacle course, getting ready to ‘thread the needle’. Unfortunately, there was a BMW 3-series going the other way so his path was blocked. Both cars came to a halt.

An imaginary flamenco guitar started to play. A ninja master peered out of the BMW. The skeleton of Arch Stanton grinned mysteriously. The Buick looked at the BMW. The BMW looked at the Buick. Several times. The imaginary music swelled as horns and a piano were added. I looked at them both but neither of them looked at me which kind of shattered my mental picture — the music ground to a halt, Arch Stanton wandered down the street to pick up her son at school and the ninja, sensing cancellation, hid.

With my movie scene gone, all I had left was the computer science textbook — the BMW and the Buick became Perl scripts that weren’t using flock properly and instead of a Mexican standoff I had a classic deadlock problem.

That went on and on…

And on…

And on.

I began to wonder if they had both gone to sleep but eventually the Buick backed up, the BMW was able to drive off, the deadlock cleared and I started shovelling out the red car.

There are two morals to this story:

First of all, proper file locking is important.

And expensive cars can make you stupid.

Advertisements

The Author

Rose Glace is the pseudonym of nobody important.

1 Comment

  1. Pingback: Licensing | Rose Glace's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s