How to get Progress updates from multiple threads...
Sorry in advance for my lack of java vocabulary. I'm new to the language.
What I have is a program that reads through a binary data file and converts it into a different binary format.
It kicks off a thread for each file and processes them all at the same time.
What I need is to know the progress of each of the files so I can let the user know percentage wise how much of the data has been processed so they aren't just sitting there staring at a the screen wondering what is going on.
So my question is... how does a thread inform it's parent of something?
Re: How to get Progress updates from multiple threads...
Re: How to get Progress updates from multiple threads...
I will read that tutorial since I will probably need it in the future, but for now there is no progress bar. It's a command line application. I simply don't know how to pass information from a thread to the parent. Is there a way to create an event listener within the parent and then have the threads trigger the event every so often telling the parent how many bytes they have processed?
Thanks for your help.
Re: How to get Progress updates from multiple threads...
There's really no magic. Just call a method that updates the progress. You will probably have to worry about thread safety, but for a first stab, simply calling a method that updates the count should be okay.
Re: How to get Progress updates from multiple threads...
Okay, I got it. Thanks so much. I always try to complicate things. =)