• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need Queue Object Management - suggestions?  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Apologize if this topic isn't the right place as I wasn't sure where to post this question into. If there is a better sub-forum to post this question, please let me know.

I am needing to know if there is something that can help me with object management. I have an application in which there are a series of files that are created. I then want to be able to run in a multi-threaded manner, the ability to grab multiple files for reading and store their data into a bean (class object). Once into the bean, I want to work and manipulate the data before storing into queue which eventually posts the data into the database. I know something such as MQ Series can be used, but I don't need anything big like that. Is there a java package that can allow simple queue management of objects that would wait to be processed as to what I am needing to do?

Thanks you,
Steven
 
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the java.util.concurrent package and the section of the Java Tutorials on Concurrency. That package has some good queue implementations and some executors that can manage thread pools for you.

My one suggestion would be: unless you know that the files are spread across multiple disks or on a RAID, I would suggest using a single thread to read the files in and put the data into your work queue - multiple threads can slow down disk access as they make the read head skip from location to location. Once the data is in the queue, then by all means have multiple threads processing the data.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!