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

  • Home
  • SEARCH
  • 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 7512397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:51:21+00:00 2026-05-29T23:51:21+00:00

I have a Java program performing some large analysis tasks, running through a loop

  • 0

I have a Java program performing some large analysis tasks, running through a loop (essentially 24/7) in one thread and accessing a number of other threads to do parallel processing. I am presently configuring the number of other active threads to send tasks to using a constant. During the day, I like to set this to a smaller value (say, 4) to leave some of my machine’s resources available for my interactive use. Overnight (or other times I leave my machine unattended) I would like the program to use a larger number of threads (say, 8). Currently I am halting the program, changing the constant, rebuilding, and restarting the program (I have to restart all 8 threads). This is becoming tedious to do on a regular basis.

I would like to set up a simple system to type a single command/script from outside Java to change the program’s behavior, so that it can remain running but vary the number of idle threads based on my input. I have searched SO for answers and know that this is apparently not possible with an Environment variable. I can think of two possibilities: set a value in a text file and read that in each cycle of the loop; and store a value in the MySQL db that my program interacts with.

While these solutions would work for me, I am interested in knowing if there are any other (more standard?) ways of having Java “configuration variables” accessible from outside the running process.

If it’s relevant, I’m running the processes from within Eclipse.

Edit: Just thought of another possibility: USR1 and USR2 signals…

  • 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-05-29T23:51:24+00:00Added an answer on May 29, 2026 at 11:51 pm

    You could add an additional thread that was always waiting for a connection on a particular port, and write a simple program to send a message to the program on that port (probably just from localhost). On receiving this message, the program could change whatever settings it wanted.

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

Sidebar

Related Questions

I have java program which receives encrypted message through TCP/IP from one component of
We have a java program that requires a large amount of heap space -
I have a Java program with Maven managing its dependencies. One of those dependency
I have a Java program in which an action is initiated which loops through
I have a Java program that processes one file at a time. This Java
I have 2 java program located seperately One in c:\test and the other in
I have a Java program/thread that I want to deploy into an Application Server
So I have this Java program that I use to munch through several terabytes
I have a Java program that loads thirdparty class files (classes I did not
We have a Java program run as root on Unix, that therefore can read

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.