Things turn out to be not so easy. Yes, I've got 4x speedup, but cycle() function generates huge amount of data (hundreds of megabytes) which should be written to a file, but my attempts to write output data from that function have no success. In my MainWindow class I have static QDataStream member out, and I'm using it for output. During execution there is a lot of qDebug messages "QIODevice::write: ReadOnly device", and output file remains absolutely empty, though if I write something to out before QtConcurrent::map() is started, it is written to a file without problems.
As far as I understand, multiple threads generated by QtConcurrent::map() somehow automatically lock out and prevent each other from writing to it. Or may be I am wrong? Anyway, what could be done to avoid this?
Please give me a hint, I'm stuck and this thing is starting to drive me crazy...




Reply With Quote


Bookmarks