troubleshooting Question

Java Parsing Multiple Files

Avatar of mmingfeilam
mmingfeilam asked on
Java* multithreading
19 Comments1 Solution68 ViewsLast Modified:
I am given an assignment to parse from multiple files and count the occurrence of a letter in each file.  I am not sure what the best approach would be.  I have come up with following possible solutions:

  1. Use ExecutorService to create a thread pool, and use callables to divided up the work (process 20 files per thread) and then merge the results.  
  2. Maybe use something like Blocking Queue to read from server the file content, and have another thread access the content to do the parsing and counting. 
I want to make it as performant as possible while avoiding making the app too complicated and error-prone.  Thanks.

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 19 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 19 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros