Hi everyone,

I have a computation that takes some time (let's say 200ms) and has to be executed all the time during program execution. Basically it takes some user input, does its 200ms work on it, delivers a result and instantly starts over again with the input data that may or may not have changed in the meantime. So I checked the Qt doc, put that stuff in a QThread subclass with it's run method looking basically like this:

Qt Code:
  1. void myThread::run()
  2. {
  3. initSomeStuff();
  4. while(true)
  5. {
  6. performLongTask();
  7. }
  8. }
To copy to clipboard, switch view to plain text mode 

This means that the thread is basically busy all day with minimal interaction with the rest of the process, which should be fine as it's a worker thread. But after I start that thread it's slowing the responsibility my GUI op to the point of rendering it almost static - can anyone tell me what I missed? I checked the doc as well as some blogs and discussions including the often quoted "you're doing it wrong" article but ended up even more unsure about the proper approach. Maybe one of you can help me.