Read this guy’s notes. Seriously. Working out my own threading issues for STDJ’s purposes, I either came to the same conclusions, or should have. Even though it’s “old skool MFC”, it has great advice that can be abstracted and applied to any multithreaded environment. I’m keeping a backup of that page.

My initial troubles came from trying to decipher the MSDN docs on how to start/end a thread. There are at least FOUR #*&@% different ways to do it, and the docs are so bad they will make you go blind if you read them all. After digging for a while, the guy at flounder.com has it right when he says only one is correct. A quick peek at the Shareaza code base shows that they agree. Upwards and onwards with AfxBeginThread()!

Other issues that he helped me with were using the volatile keyword on shared (and properly locked) variables, and using ::PostMessage, not ::SendMessage, from thread to thread (I should have figured that one out, sigh…).

If I get enough time I am hopeful about switching to boost’s thread library in the future.

New release, should be able to view others’ playlists now.  No, really.  Find it in the usual place.

Hey all, new HTDJ drop, John wanted the arrow keys to adjust the volume, like they used to before I “fixed” everything! It’s on the HTDJ website, as usual. Even more interesting, John’s been making progress on the latest incarnation of his space game, Terminus Est. Check it out!

In the HangTheDJ/ShareTheDJ update I’m posting today, I’ve switched to sending my serialized data as HTTP multipart form data. This allows binary transfers. Before I was using POST variables, and embedded ampersands and all sorts of other characters caused truncation and all sorts of other problems. So you can now actually see playlists coming through with much better success now.

HangTheDJ website

New HangTheDJ release, first working ShareTheDJ release, and the first scraps of a User Manual. All presented on a shiny new web site. Whoa. 😛

HangTheDJ website

UPDATE: Another new release (0.30) today (Friday 2/18), you can now watch other users’ dynamically-updated playlists.  See the website for more.