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.

Two-second text rendering tutorial: (continued…)

The PNG format is nice because it’s supported by Firefox and it has real alpha-based transparency. This looks great no matter WHAT color your background is:

I have been working on improving the alpha on the category images here, specifically the MythTV and Linux-projects category images. Here’s how (continued…)

A great feature of C++ is that shallow copy constructors and assignment operators are done for you. If you have a class with simple types, you automatically get the ability to construct a clone of any existing object, or assign any one object to another.

However, if you have member variables that are involved in any kind of dynamic allocations, you’re going to need to override the default copy/assignment functions with your own “deep copy” versions.  (continued…)

I recently used Apache 2.0’s HTTP Basic Authentication (via mod_auth_dbm) to restrict access to portions of my website. It’s simple as pie. (continued…)