[Qt-interest] Using multiple thread, GUI dumps core at exit
Rehan
rehan at india.synfora.com
Fri Feb 26 10:46:18 CET 2010
Hi Scott,
Actually I am using Qt-3.3.6, hence I am using postEvent.
In closeEvent, I have check, if thread is running then terminate before
closing the window.
If I use only one thread to load only one file, it works fine.
I am attaching sample code base. If you find any discrepancy, please let me
know.
Regards,
Rehan
_____
From: Scott Aron Bloom [mailto:Scott.Bloom at sabgroup.com]
Sent: Friday, February 26, 2010 1:21 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Using multiple thread, GUI dumps core at exit
Most likely you are not properly stopping the and deleting the threads
correctly.
However, why use post events? Why not just use signals and slots?
Scott
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Rehan
Sent: Thursday, February 25, 2010 22:21
To: qt-interest at trolltech.com
Subject: [Qt-interest] Using multiple thread, GUI dumps core at exit
Hi All,
I have 3 huge files those I want to load in multiple threads. I used two
approaches but I have some issues in both.
1st approach:-
My GUI is in main thread. I am loading all the 3 files in 3 different
concurrent threads.
I am handling postevent also, to attaches all the threads into main
thread, because I have to display the data in GUI.
In this approach everything works fine, but while I quit GUI, it dumps
the core.
I have verified there is no global destructor and main GUIs destructor
is also getting called only once.
If I have only one thread instead of 3 apart from main thread, it
doesn't dumps core.
2nd approach:
GUI is in main thread.
I load first file in a separate thread, it is taking 14 sec to complete.
In the postevent of the previous thread, I create another thread to load
another file; it is taking approx 3 minutes to load.
And same in second threads postevent I am creating third thread to load
my third file. It also takes approx 3 minute to load.
If anyone has faced this type of issue and has some clue, please respond.
Note: While in first approach all the 3 files take 14 sec to load.
Regards,
Rehan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100226/c607e594/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.cpp
Type: application/octet-stream
Size: 1867 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100226/c607e594/attachment.obj
More information about the Qt-interest-old
mailing list