Hi,
I'm looking for suggestions for a framework GUI with computationally intensive threads. Practically, the GUI should have a button that starts one manager
thread. That manager thread will start a number (about 20 to 40) of worker threads that are computationally intensive and each thread runs for about an hour. The worker threads should report progress / messages back to the manager thread. The manager thread should report messages back to the gui, ie JTextArea, that describe the worker thread configuration, status, progress, and final results. Also, the manager thread should accumulate and rank the results for display in the GUI.
When I write this definiation down, I think, I can use invoklater to start the swing thread. When a button is started, start a manager thread. The manager thread determines the number of cpus, sets up an executor service, and starts running the worker threads.
But, how do the worker threads communicate back to the manager thread in a thread safe manner, and also, how does the manager thread communicate back with the swing elements.
I have been playing with a MVC formulation, but I'm thinking an publisher / subscriber system makes more sense, since there are only messages going one way.
Oh, but I fogot, need to be able to press cancel to stop the whole thing in a safe manner, ideally with worker threads writing their progress to a file so they don't have to start over from scratch.
And, if the above isn't enough question, how do I write
unit tests for the various components .... Can I be a "good programmer", and start by writing the unit test first?
John