05-12-2013 09:29 AM - edited 05-12-2013 09:44 AM
p.s. Cascades forum section is better for this question.
05-14-2013 10:28 AM
05-15-2013 04:23 AM
I don't really understand why you would not suggest mult-threading. Using Qt this is much easier and much less of a pain than in most.
I suggest reading some docs on the Qt way of threading, which is fully supported in cascades.
Something mentioned in there that I want to stress is important; you should practically never inherit from QThread. You use threads, you don't want to inherit from them. See the first doc
05-15-2013 11:00 AM
It's not that multi-threading is inherently wrong or anything, it's just that many people don't really appreciate just what can go wrong when using lots of threads. If someone isn't very concerned about using threads I would argue they don't really understand the concepts well enough.
For the most part, people tend to just have some long-running method they want to offload from their event thread and QtConcurrent::run()/QFutureWatcher does the job very nicely.
Also, many people unnecessarily involve additonal threads because they don't really understand the options available to them. For example, I have seen many people spin up a thread to run a BPS event loop, despite this conflicting with the Qt event loop already pumping BPS, and the framework having AbstractBpsEventHandler built-in for their convenience.
If you are comfortable with QThread, QMutex, locking, etc, then go for it. Just stop and really think about why you need/want to do this. That's why I said that I generally tell teams "don't".