Thursday, August 10, 2006

Playing With Threads

This week, our team schedule was testing with Tootsie, one of eleven modules for OWG Project. One of the biggest problem in this module is about threads. We need a thread for producing some kind of progress bar along with some kind of sounds which reflects the progress bar (it's mainly used for the sound as the progress bar uses Timer to do the job). The sound is increasing all the time along with the progress bar and it will stop when the progress bar has reach its limit. The problem was that the thread must be suspended when the application lost it's focus or open another window, for example, opening a score window) and it must be resumed again when it has the focus back. Sometimes, it took some time for the system to fully stop/suspend the current threads, so if i open new window and back to the application and do this few times, the sound will not match with the progress bar. So i need some kind of syncronizations.

Somebody who has played with threads will know that it's quite difficult to do, as threads mostly used in a parallel tasks and it has to be syncronized along all the threads (mostly for financial application), but luckily in my project, it didn't have any relation with important data at all, so the constraints are less. Even so, threads is still a pain in the development phase. Let's hope there's no major problems with threads in the next few days as i'm going back to Jogja and have a holiday starting at Saturday and came back to Jakarta at 22 of August 2006.