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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:42:47+00:00 2026-06-09T04:42:47+00:00

ScheduledExecutorService seems to have the problem that if it can’t get a free thread

  • 0

ScheduledExecutorService seems to have the problem that if it can’t get a free thread the periodic task will happen with delay. Unfortunately for me, the periodic task it’s assigned to really does need to happen fairly on schedule. At present it’s scheduled for once per minute but sometimes due to the application being busy with other things (I assume this is why) it fails to make it within five minutes, and five minutes happens to be the “major production bugs” threshold.

How to force this via prioritizing or otherwise controlling the thread balancer?

  • 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-09T04:42:49+00:00Added an answer on June 9, 2026 at 4:42 am

    If your ScheduledExecutorService is used for other tasks or if your task sometimes takes more than 1 minute to run, you can simply increase the number of threads available in your ScheduledExecutorService. So if one task has not finished running, the executor will still be able to run a new one.

    ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(10);
    

    (I picked 10 randomly – if you run your task every minute and it can run for up to 5 minutes, that leaves you some margin for error)

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

Sidebar

Related Questions

I am having this problem, I have private ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); and task
I have a ScheduledExecutorService and I do a task every 15 mins (in a
From my readings, it seems that ScheduledExecutorService is the right way to start and
I am using a ScheduledExecutorService to execute a task that calls a service at
Suppose I have a task that is pulling elements from a java.util.concurrent.BlockingQueue and processing
I have a fixed thread pool that runs 7 concurrent threads at any time
I have a task that I want to run at a fixed rate. However
i have a ScheduledExecutorService that gets tasks for periodically execution: scheduler = Executors.newScheduledThreadPool( what
I am trying to implement a ScheduledExecutorService thread that loops every second, but as
I have an object that needs to do periodically do some work while the

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.