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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:37:28+00:00 2026-05-27T12:37:28+00:00

I have a singleton class that is shared by some threads. within a method

  • 0

I have a singleton class that is shared by some threads.

within a method of this singleton i want to create another thread to do some job (so any thread that uses this singleton can start the additional thread job)

Right now I start threads in simple way:

mSThread = new Thread(job that implements Runnable);
mSThread.start();

Thread mSThread is declared as class member, I don’t think that I need to keep reference to the threads so it’s ok that every time a new thread is created the reference will be lost

Is it ok to do what i did or i should use a different technique like thread pool?

  • 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-27T12:37:29+00:00Added an answer on May 27, 2026 at 12:37 pm

    It is not absolutely necessary to keep a reference to the thread object, so if you don’t need it for anything else, you don’t need to store it in a member variable; you can just start the thread and forget the reference.

    Whether you should use a thread pool, depends on what exactly your application does, how often you expect to start new threads, etc.; without further information it’s hard to say whether this is worth it or not. If you do this, you’ll want to use the classes from the java.util.concurrent package. Using an ExecutorService you can start background tasks in a thread pool.

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

Sidebar

Related Questions

I want to have singleton class that its object is not statically created. having
I have a C# singleton class that multiple classes use. Is access through Instance
I have a Singleton that is accessed in my class via a static property
I have a co-worker that swears by //in a singleton Constants class public static
I have a singleton class for global access to config information. This singleton class
The goal is to have a singleton data controller class called FetchData.h/.m that pulls
I'm implimenting my own ApplicationContext class that uses the singleton pattern. I want to
I have a singleton class called SingletonController1. This SingletonController1 instantiates a bunch of others
I have class that I believe should not be a singleton or static class.
I have a small query, How to create and export Singleton class from DLL?

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.