threaded programming fail

Sep 10, 2008 10:01

It's been a few months, but I finally got around to putting my music collection on my work laptop. And after putting it on, of course I need to install a music player. For years I swore by Winamp (the 2.x series, 3.x was garbage, and I never got around to 5.x), which worked quite well, but even I have the need for convenient and flexible playlists on occasion. At my old job I used iTunes, because for all it's issues, it really wasn't all that bad.

So I went to install iTunes 8. The installation went fine (though why a music and movie player needs to be a 64 meg download is beyond me), and the album art fetch is cute. So why the post? Usually when I post about software it's to complain about it failing in some way or another. This will not be an exception.

While it's doing the art fetch, music plays choppy. No wait, that's a bad description. It's like listening to a vinyl LP with an ADD 2-year old shaking the music cabinet. Completely worthless. Though it's worse than the 2-year old, because you can't even destroy music you don't like while it's downloading the art.

The thing is, there are methods of writing software to do multiple things at the same time so that the music player can be happy playing music while the album art fetcher gets art, etc. The most typical of this is threaded programming; where multiple "threads of execution" run at the same time, and communicate using using one of the dozens of known "thread safe" methods when necessary. Heck, most GUI libraries even have "send message X back to the GUI thread". Those of you who have ever used iTunes on a mac to rip a damaged CD will understand how broken iTunes is, and arguably how broken OS X is as a platform (I've had to cycle power to get it to stop trying to rip the disk and get it out of the drive). But this is just a symptom of a failure to understand basic GUI and thread programming.

Back when I first started writing GUIs, I did as Apple is doing and had the main thread do everything. This was obviously the wrong thing to do. So glaringly obvious when your application stalls for a half-second while you parse some data file. That Apple hasn't figured this out, despite the debacle that was OS 1-9 and cooperative multitasking, is amazing. Don't they have QA? Don't their engineers run the application?

The loading of 400 disks worth of art is done, and so is my rant. Apple: make better software!

software

Previous post Next post
Up