Posted on 2004-11-26
Right, I've got my objects and they're all threading and running nicely - only I now have another problem :)
I run three threads and the next stage of the application is to combine the results of those threads. This is posing a problem because I'd first need to know if all three threads have completed before beginning stage two. I thought that I could "register" the threads in an ArrayList or somesuch and when complete, get the run method to remove themselves from the list. Thus when the list is empty, I know the results are all ready.
The only problem with that is that I'd need a while loop to keep on checking :
I was wondering if there was a better less intensive way of doing this? I imagine there is - but my googling and tutorial reading hasn't found it yet.... although I'm still looking ;)