• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need Queue Object Management - suggestions?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic