Multi-Threaded Application - Help with some pseudo code!!

Posted by HonorGod on Stack Overflow See other posts from Stack Overflow or by HonorGod
Published on 2010-04-14T18:49:03Z Indexed on 2010/04/14 18:53 UTC
Read the original article Hit count: 210

Filed under:
|
|

I am working on a multi-threaded application and need help with some pseudo-code. To make it simpler for implementation I will try to explain that in simple terms / test case.

Here is the scenario -

I have an array list of strings (say 100 strings)

I have a Reader Class that reads the strings and passes them to a Writer Class that prints the strings to the console. Right now this runs in a Single Thread Model.

I wanted to make this multi-threaded but with the following features -

Ability to set MAX_READERS

Ability to set MAX_WRITERS

Ability to set BATCH_SIZE

So basically the code should instantiate those many Readers and Writers and do the work in parallel.

Any pseudo code will really be helpful to keep me going!

© Stack Overflow or respective owner

Related posts about java

Related posts about concurrency