Do not feel like looking at ur code.
But i can see u are attempting to use GUI with threads.
ALL GUI's are not thread safeeven if they tell you they are, they are not. (this hold true for all languages)
objects in the gui can only be called with the thread that created them.
if you attempt to call from another threads 99% of the time it works, and then u get wierd mysterious crashes.
So how do u update the gui.
2 methods.
1 use the gui's event system (assuming that the gui has one wxwindows has, windows has)
each worker thread passes info using events to main thread which updates gui.
2 use queues (thread safe ones), if language does not have make ur own.
each worker thread add events to the queue, main thread polls the queue, and then updates gui.
(this is actually a variant of number 1 method)
i use this method since you have more control. also event system should be thread safe, but you could have some shared variables which can cause nasty, this eliminates it.
also as rule of thumb, share as few variables as possible.
with the queue system you should only have to share 1 queue.
also even if they tell u library is thread safe, assume they are lying
