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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:24:42+00:00 2026-05-27T13:24:42+00:00

Inside first thread I need to create another thread. Thread thread2 = new Thread(bworker);

  • 0

Inside first thread I need to create another thread.

Thread thread2 = new Thread(bworker);
thread2.start(); 

The problem is that when first thread finishes it’s job, thread2 get’s terminated though it has more work to do.

How can I keep it alive until it finishes it’s work?

I don’t want to use join because it will block the flow of the first thread.

  • 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-27T13:24:42+00:00Added an answer on May 27, 2026 at 1:24 pm

    The second thread won’t be automatically terminated when the first thread finishes. That’s not how threads work. The only thing like that is that the whole process will terminate if there are no non-daemon threads alive. Assuming that’s not the situation here, I think your diagnostics are messed up around the second thread – or it’s dying for some other reason.

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

Sidebar

Related Questions

How to get the first child id inside the div using JQuery. Sample code:
I have problem understanding the meaning of join in the following case: Thread t1=new
I'm trying to run a Random method inside a Thread. I need to put
I have the following situation: There is one custom view inside of the first
I often refactor code first by creating an inner class inside the class I'm
I am trying to apply css on the first A element inside .Outer, .Outer
I have a UINavigationController inside a UITabBarController. When a user presses the first tab,
I have two updatepanels inside an accordion control, laid out like this: <accordion> <first
I've a must to create wcf service with parameter. I'm following this http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/8f18aed8-8e34-48ea-b8be-6c29ac3b4f41 First
Is there a possibilty to make a thread that is only for showing a

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.