Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8115549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:30:47+00:00 2026-06-06T03:30:47+00:00

Hi i have requirement to process large number of files via multithreading in java.

  • 0

Hi i have requirement to process large number of files via multithreading in java. The files will be of random size (min:100 MB , max :1.5GB).The configuration is i can only create 8 thread at the max and each thread will be allocated 8 files for processing from the source directory.The issue is sometimes huge files are getting allocated to single thread itself thus degrading the performance. I want know whether there is anyway to allocate files to thread such that all threads will be processing equal amount of size. I mean i want to balance the load among the threads on the basis of file size.

Thanks in advance 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:30:48+00:00Added an answer on June 6, 2026 at 3:30 am

    You should not even be doing parallel I/O from a single mechanical disk, as it is in fact slower than single threaded I/O. There are a lot of answers around here explaining that. Basically the mechanical head of the disk needs to spin every time to seek the next reading location. This is a costly operation. If you do this in parallel then you are just bouncing the head around as each thread gets its turn to run.

    The best approach would be to just read the files one-by-one sequentially using a single producer thread and process them in parallel using a pool of worker threads.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a requirement in which i need to process few data to generate
I have a requirement to (very) quickly process strings of a limited range, tallying
I have an object that was stored via mongo-java-driver. Object uses java.util.UUID for its
I have a requirement to process a lot of data on nightly basis. I
I have a requirement where 1 process sets a value as environment variable and
I have a requirement to hide a process in Task Manager. It is for
I have a requirement in my project where in i have to kill process
I have a requirement where a process can be implemented in 2 different situation.
We have a business requirement to process as much of a file as we
I have requirement where the component is responsible for receiving a message and process

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.