Question: Implement a parallel word counter. Clients (threads) submit short texts to a waiting queue. Wordcounters take texts from the waiting queue and store in a
Implement a parallel word counter. Clients (threads) submit short texts to a waiting queue. Wordcounters take texts from the waiting queue and store in a map how many times each letter appears (one map per thread). When all threads are finished executing the main thread aggregates all the maps and outputs the total word for all the submitted texts. Each client submits 10 texts and there are 100 clients. Solve the concurrent access to shared resources using objects lock, wait and notify.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
