Implementing java FixedTreadPool status listener

Posted by InsertNickHere on Stack Overflow See other posts from Stack Overflow or by InsertNickHere
Published on 2010-05-14T06:31:01Z Indexed on 2010/05/14 6:34 UTC
Read the original article Hit count: 276

Filed under:
|
|
|

Hi there,

it's about an application which is supposed to process (VAD, Loudness, Clipping) a lot of soundfiles (e.g. 100k). At this time, I create as many worker threads (callables) as I can put into memory, and then run all with a threadPool.invokeAll(), write results to file system, unload processed files and continue at step 1. Due to the fact it's an app with a GUI, i don't want to user to feel like the app "is not responding" while processing all soundfiles. (which it does at this time cause invokeAll is blocking). Im not sure what is a "good" way to fix this. It shall not be possible for the user to do other things while processing, but I'd like to show a progress bar like "10 of 100000 soundfiles are done". So how do I get there? Do I have to create a "watcher thread", so that every worker hold a callback on it? I'm quite new to multi threading, and don't get the idea of such a mechanisem..

If you need to know: I'm using SWT/JFace.

Regards, InsertNickHere

© Stack Overflow or respective owner

Related posts about java

Related posts about threads