Commit 122071d0 authored by drnull03's avatar drnull03

ANSWERING_AND_PROPOSING_A_SOLUTION.pdf and changed the readme

parent c08df5be
To run the code provided just head to the root of the project
then type
mvn clean
mvn compile
mvn exec:java
PS: The middle layer multiple consumers just CAPTILIZE the Strings
The code is commented and easy to understand
six threads at play here:
1.main thread.
2.producer thread.
3.three consumerCap threads.
4.one ConsumerWriter thread.
\ No newline at end of file
...@@ -4,6 +4,13 @@ import java.io.FileNotFoundException; ...@@ -4,6 +4,13 @@ import java.io.FileNotFoundException;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
//here we did offload the thread shared content to be managed by main thread
//note to the instructor having saparate maing thead in App.java in every project is always better lets keep doing this pls :)
public class App { public class App {
public static void main(String[] args) { public static void main(String[] args) {
...@@ -14,7 +21,7 @@ public class App { ...@@ -14,7 +21,7 @@ public class App {
BlockingQueue<Message> fileContentQueue = new LinkedBlockingQueue<>(); BlockingQueue<Message> fileContentQueue = new LinkedBlockingQueue<>();
BlockingQueue<Message> postProcessingQueue = new LinkedBlockingQueue<>(); BlockingQueue<Message> postProcessingQueue = new LinkedBlockingQueue<>();
//this can be changed and it will still work
int numCapConsumers = 3; int numCapConsumers = 3;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment