PDA

View Full Version : QThread - Still having issues



sgrant327
24th May 2010, 18:58
Ok,

I have been trying several different approaches to threading my app. I have posted questions about creating and maintaining several threads, have gotten suggestions, implemented them and still...no go..

The threading model I use works for a while, then bombs out at various points.

What I have so far:

GUI -> create threadMGR.

threaMGR -> create 4 processTHD's.

threadMGR -> divide one list of 4000+ items into 4 lists

threadMGR -> start processTHD's

processTHD -> wait for threadMGR to pass in a filename and set start flag, then process file

each processTHD emits a 'finished' signal. this finished signal is connected to a 'restart processTHD with new filename' slot in the threadMGR.

each processTHD also emits update signals while processing. each update signal is connected to a unique slot in the threadMGR. each of these update slots in the threadMGR emits an update signal that is connected to an unique slot in the GUI thread, for updating counters.

No, I cannot post the code here, but will try to make a super-simple version to post later...

If anyone has any additional pointers, please let me know.

--Sam

tbscope
24th May 2010, 19:32
Define "bombs out"!
Does your computer explode when you run your program?

sgrant327
24th May 2010, 19:37
Very much so!

By "bombs out", I mean that I get segmentation faults. Usually at different points. Sometimes in reading an thread-local index, sometimes I get memory errors related to thread-local QStrings...

sgrant327
25th May 2010, 14:31
One additional item...

Most of the time, when the app crashes...in the debugger, the app stops in qatomic_i386.h: QBasicAtomicInt::ref()...

Any ideas?