Andrey, you are right if I'm not using the signals/slots, but calling it
directly causes it to run in current thread. It works just fine now, thanks.
Denis, I did check out QtConcurrent::run(), but since I return void from
the function and I have to call the function multiple times possibly in the
Thanks Denis, I'll look into QtConcurrent + QFutureWatcher tonight when
I'll have time. I will also consult pthread's documentation after comparing
the two approaches.
Thanks again
Kris
On 29 May 2014 11:01, Denis Zalevskiy
wrote:
> On Thursday 29 May 2014 13:55:40 Denis Zalevskiy wrote:
> >
On Thursday 29 May 2014 13:55:40 Denis Zalevskiy wrote:
> To run parser in parallel just to get results in the main thread it is
> better to use QtConcurrent::run() + QFutureWatcher.
>
Also, to set priority I guess you can use posix pthread functions, smth. like
::pthread_setschedprio(::pthread_
On Wednesday 28 May 2014 22:07:20 Andrey Kozhevnikov wrote:
> need to look into your parseReadyData
>
> 28.05.2014 22:03, Krisztian Olah ?:
> > Hi Andrey,
> >
> >Thanks for the answer, your snippet looks very similar to what I
> >
> > have. Perhaps if I posted my code segment would be of
I see, I'll give it a go and get back with the result.
Thanks for your help Andrey
Kris
On Wed May 28 2014 19:38:35 GMT+0100 (BST), Andrey Kozhevnikov wrote:
> you can't do it. you should call it with slot only, else it will be
> called in current thread, not one you created.
>
> 28.05.2014 23
need to look into your parseReadyData
28.05.2014 22:03, Krisztian Olah ?:
Hi Andrey,
Thanks for the answer, your snippet looks very similar to what I
have. Perhaps if I posted my code segment would be of help in helping
me figuring out where I'm wrong.
During parsing CPU usage reache
Hi Andrey,
Thanks for the answer, your snippet looks very similar to what I have.
Perhaps if I posted my code segment would be of help in helping me figuring
out where I'm wrong.
During parsing CPU usage reaches 97-100% which causes my GUI to hang(I
have about 500 000 opening and closing tags
it can't "doesn't help much". you initializing thread wrong.
simple threading way is:
MyXmlParser *parser = new MyXmlParser(xmlDocument);
QThread *thread = new QThread(parser);
parser->moveToThread(thread);
QObject::connect(thread, SIGNAL(started()), parser, SLOT(parse()));
QObject::connect(pars
Hi list,
I have a rather large xml file to parse and it causes the UI to freeze, I
assingned the parser to a different thread, but it doesn't help much.
According to the Qt documentation QThread::setPriority() doesn't work on
Linux, is there some kind of workaround that could be used?
Than