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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:46:23+00:00 2026-05-31T09:46:23+00:00

So I have my Android Bluetooth application that has it’s host and clients. The

  • 0

So I have my Android Bluetooth application that has it’s host and clients. The problem is, because I am making multiple connections, I need a thread to handle each connection. That’s all milk’n’cookies, so I thought I’d stick all the threads in an array. A little research says a better method to doing this is using a Thread Pool, but I can’t seem to get my head around how that works. Also, is it actually even possible to hold threads in an array?

  • 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-31T09:46:24+00:00Added an answer on May 31, 2026 at 9:46 am

    A thread pool is built around the idea that, since creating threads over and over again is time-consuming, we should try to recycle them as much as possible. Thus, a thread pool is a collection of threads that execute jobs, but are not destroyed when they finish a job, but instead “return to the pool” and either take another job or sit idle if there is nothing to do.

    Usually the underlying implementation is a thread-safe queue in which the programmer puts jobs and a bunch of threads managed by the implementation keep polling (I’m not implying busy-spinning necessarily) the queue for work.

    In Java the thread pool is represented by the ExecutorService class which can be:

    • fixed – create a thread pool with a fixed number of threads
    • cached – dynamically creates and destroys threads as needed
    • single – a pool with a single thread

    Note that, since thread pool threads operate in the manner described above (i.e. are recycled), in the case of a fixed thread pool it is not recommended to have jobs that do blocking I/O operations, since the threads taking those jobs will be effectively removed from the pool until they finish the job and thus you may have deadlocks.

    As for the array of threads, it’s as simple as creating any object array:

    Thread[] threads = new Thread[10]; // array of 10 threads
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Android native java application that reads data from a Bluetooth
I have an Android Bluetooth application which manages a couple of remote devices( Capsules
I am using Eclipse to develop an Android application that plots Bluetooth data. I
I made an application that is using Android SDK 2.1. This application uses bluetooth
May i achieve that server side application (using android bluetooth API)connect to particular client
I am trying to develop an android application that will use Bluetooth capabilities to
I have an application that is talking over Bluetooth to a server on a
I have written an application for Android. the main part being that it communicates
I have modified the Android Bluetooth Chat code so that bytes received from the
I have android.permission.READ_OWNER_DATA but I can't find any reliable code that would explain how

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.