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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:18:08+00:00 2026-06-08T10:18:08+00:00

I would like to make my own ThreadPool type class in Java (I tried

  • 0

I would like to make my own ThreadPool type class in Java (I tried in the past and kept getting concurrent exceptions – I forgot the specific error) and i’m back to it again.

This would be used to on the fly, easily create different threads to run different processes concurrently and then when a task finishes in the thread it was passed to, it would be recycled and reused for another purpose. This is for a 2d game engine in Java that I coded myself.

This would be used for things such as collision, audio, animation management, timing, controls, etc. These are just options for the reason i need a ThreadPool class.

Problem: The last time I tried this, I created a ThreadPool class that held an Array of type “AudioThread” (or something similar) that was an inner class that overrided the “run” method. When creating a ThreadPool class, I would pass a number of threads to be created and that would be stored in the array for later manipulation.

I would then try to create methods such as “assignTask(ThreadTask task)”, “freeThread()”, getFreeThread(). etc. But from making changes to the threads, I got concurrent errors of some sort.

Bottom line, does anyone have experience making a ThreadPool type class that can offer experience to what I can and cant do? Suggestions for fixing this problem? Advice? Thoughts?

Thank you.

  • 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-08T10:18:10+00:00Added an answer on June 8, 2026 at 10:18 am

    You probably want to use ThreadPoolExecutor. It sounds like it does exactly what you want.

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

Sidebar

Related Questions

I would like to make my own user-mode NAT application. I have the folowing
I would like to make every EditText object have own title like in Pure
In order to make bundle work on its own i would like to call
I would like make an extension method for the generic class A which takes
Would like to make anapplication in Java that will not automatically parse parameters used
I would like to make my own iPhone Application Templates in XCode, based on
Making a ternary logic table, and I would like to make my own function
I would like to leave OpenGL's lights and make my own. I would like
I would like to make my own dialog, completely drawn myself, as a custom
I would like to make my own compenents using, and for, VC9 & Visual

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.