Threading Building Blocks (TBB) for Qt-based CD ripper?

I am creating a Ripper CD application in C ++ and Qt. I would like to parallelize the application so that multiple tracks can be encoded at the same time. Therefore, I structured the application in such a way that the encoding of the track is a "Task", and I am working on a mechanism for launching a number of these Tasks at the same time. I could, of course, accomplish this using threads and write my own task queue or work manager, but I thought Intel Threading Building Blocks (TBB) might be the best tool to work with. However, I have a couple of questions.

  • Is encoding a WAV file in a FLAC, Ogg Vorbis or Mp3 file something that will work as a tbb :: task? The training document states that "if threads are often blocked, there is a performance loss when using the task scheduler." I don’t think that my encoding tasks will often be blocked for mutexes, but I will need to access the disk relatively often, since they have to read WAV data from the disk for encoding. Is this level of disk activity problematic in the sense described in the textbook?
  • Does TBB work with Qt? When using Qt streams, you can transparently use the Qt signal / slot mechanisms in streams. Would the same be true if I used tbb :: tasks instead of Qt threads? Will there be any other "mistakes"?

Thanks for any ideas you can provide.

+5
source share
2 answers

TBB should work well, even transparently, with other thread mechanisms, so theoretically there should not be anything that prevents you from using the QT stream classes in the same program. If there is something more natural with QT streams like the GUI, use them and save the TBB stuff as best you can or want to.

, TBB, . , . , - , , .

TBB / parallelism . , , - ? , ?

+1

All Articles