Saturday, October 20, 2012

One Thread, Two Thread, Red Thread, QThread

QThreads are not actually difficult to implement at all!

In fact, according to this reference, subclassing is not only unneeded but actually discouraged, and one can simply initialize a new thread object with Qt's signal-slot "queued connections" interface. Sounds great, looks clean and simple, and conducive to code organization too!


Fact: multi-threaded applications become more and more unstable the more individual threads communicate with other threads and objects, especially those created / owned by other threads.

It almost might make more sense to finally learn how to use mutexes...or are they muteces? Mutices? Whatever they are, they could be quite useful. I just need to figure out this QThread stuff, and then head on back over to the fantasy land that is OS X and force myself to understand how Apple decided their computers should handle multi-threading with the mystical NSThread class.

Actually, it's not that QThread itself is giving me problems. It's the fact that the class member functions are "protected" and I can't seem to access them as signals. It's more than a little annoying, but I'm using the Qt Project forums and am expecting answers soon. They've already been surprisingly helpful in a surprisingly short amount of time. They're the ones who initially told me about the documentation for the new QThread class.

Thing is, I'm starting to think that perhaps I somehow don't have the right libraries installed. I have 4.8.3, which is the "latest" version available (and also currently the only version I can find with VS 2010 builds) - the documentation is for "Qt 5.0," which I can't find anywhere.

Back to waiting for answers.

No comments:

Post a Comment