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 8142823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:55:33+00:00 2026-06-06T12:55:33+00:00

Assume a multithreaded application scenario, in which every thread acquires some data (one or

  • 0

Assume a multithreaded application scenario, in which every thread acquires some data (one or more files) from the network, performs some processing and then saves the results on the hard disk of the hosting machine.

In such a scenario, there is always the possibility that the disk space is exhausted, leading to unexpected service behavior (e.g., a system crash).

To avoid a case like that, it would be helpful if Java provided a means of reserving hard disk space, but, as verified in an earlier question, such an option is not available and even if it were, it could lead to inefficient allocation (e.g., in the case of a decompressing application, which does not know beforehand the total size of the decompressed data).

So, an alternative could be to make “virtual disk space reservations”, e.g. by keeping in memory a static registry of the free space and having each thread request capacity from the registry before proceeding.

Are there any better alternatives, or improvements to this approach?

Is there any (preferably open source) Java library that implements such functionality?

  • 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-06T12:55:34+00:00Added an answer on June 6, 2026 at 12:55 pm

    An abstract way to implement this might be to use a constant or user inputted value of how much disk space the multi-threaded application is allowed to use, save this as variable and have synchronized get and set methods that will get the value of allowed space, allocate it space for the thread (as much is needed but not more then available), and then minus that from the total so other threads may see a decreased ‘disk space’ and once a thread has finished and data is deleted re-add the value so the used ‘disk space’ becomes usable to other threads?

    EDIT:

    it could lead to inefficient allocation (e.g., in the case of a decompressing application, which does not know beforehand the total size of the decompressed data).

    If this occurs and the thread ‘sees’ (through a constant check while extracting file) that it has reached its limit of ‘disk space’, it could then request for more space allocation if available, or be put back into a queue until the needed space has been free’d up by other threads

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

Sidebar

Related Questions

Assume I have a application that stores data,gets data and processes data and stores
We have created a multi-threaded application which process/parse big files (few hundred MB's) simultaneously.
Assume you have a file which has been committed in your Git repo. You
Should my multithreaded application with read only properties require locking? Since nothing is being
Is it correct to assume that GetLastError (and variants) are per-thread or is it
This issue has come up in a distributed-multithreaded application I'm developing, where threads can
I'm preparing to write a multithread network application. At the moment I'm wondering what's
I know there is no standard way of forking a multithreaded process. However, one
Our multithreaded application does a lengthy computational loop. On average it takes about 29
Assume a multi-threaded environment and a (properly synchronized) class that has one particular procedure

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.