Deadlock

| 5 Comments

I’ve been coding for around 25 years, since my parents bought me a VIC-20. I think it was probably a similar advert to this one by William Shatner that convinced them to buy it after seeing how much time my borther and I spent playing with our Atari 2600.  It was a sizable investment in new technology for them at the time, but one that has helped me to earn my living for over 10 years now. In that time I’ve written many multi-threaded applications and considered myself reasonably “thread-savvy”.  Most of the stuff has been web based applications but I’ve done my fair share of client side work before and I’m currently doing a lot of it.

This morning I encountered a Deadlocking problem for the very first time outside of a question in a technical interview, in fact if it had not been preparing for technical interviews then I may never have even come across the term before.  As I did my degree in Physics and not Computer Science, I’ve always had a bit of a weak spot around my use of formal computing terms – sadly my knowledge of Physics isn’t much better as I spent most of my time in the college bar and the JCR.  The reason I’ve probably only come across a real deadlock now is that most of my professional life has been spent inside J2EE application servers or on the server side of .NET where you tend to be deliberately insulated from such things.

Anyway, thought it was worth a post to commemorate this day – it took me a while to track down (would have been longer if it wasn’t for the debugger in Eclipse).  Had I not spent the odd day here and there preparing for technical interviews it probably would have took me longer.  You never know – one of these days I might actually write a real binary search algorithm or use some of the other interview favourites… 

5 Comments

I spent a couple of months investigating thread starvation issues in an old job a few years ago. I did have peculiar dreams during that time too, as I was thinking about the work most of the time.

Deadlock happens in J2EE world quite a lot if you're not too careful with transaction demarcation. I've seen a bunch of code written that produces spurious deadlocks, and it seems to have always been bad transaction demarcation.

Started on a Vic-20? Me too.

The VIC 20 was my first computer too, though I'd never seen that Shatner commercial. Good stuff. My dad had a handful of Epson machines running CP/M for his business, and occasionally he brought one home and I'd play with it a bit, but the VIC 20 was the first machine that was really mine. I'll never forget waiting for what seemed like hours to load a BASIC program off the cassette drive, or typing thousands of lines out of Byte magazine followed by days trying to fix whatever I'd gotten wrong. Good memories!

That's how I learnt how to debug. A couple of times it was actually the program in the magazine that was wrong - they were the best ones to figure out but they would take weeks.

Vic-20... What? No Apple IIe programmers here? I think there are printouts of these programs at my parents house somewhere.

Ahh. Those were the days. I remember begging and pleading for my folks to spend that money on the 5.25" disk drive.

Archives

Creative Commons License
This blog is licensed under a Creative Commons License.