[Qt-interest] High performance pipeline (QThread)
Thomas Richard
thomas9999 at gmail.com
Thu Sep 30 21:19:33 CEST 2010
Hey all,
My objective is to build a library that is able to grab some data from
somewhere and then do some heavy calculations on this data. These
calculations happen in steps, and it'd like to take advantage of
multithreading here. Basically what i need is a pipeline that passes
results from one thread to another. A catch is that more threads can
be subscribed on the results of a previous thread. So the pipeline can
split up.
I first thought about implementing this using QWaitCondition, which
will probably be the most performant way to do it. I'm afraid it will
get very complex pretty soon though and deadlocks are easy to create.
My second thought was to give each thread it's own eventloop and
communicate using queued signal/slot connections. This would be way
more easy to maintain but.. here (finally) comes my question:
What's the cost of doing this. Will i lose alot of speed using
signal/slot connections or is this loss unsignificant? What are the
downsides of running an eventloop in each thread?
Thanks
Thomas Richard
More information about the Qt-interest-old
mailing list