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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:40:28+00:00 2026-05-26T00:40:28+00:00

I need to start a thread, but continue just after the thread is actually

  • 0

I need to start a thread, but continue just after the thread is actually running. Now my code looks like:

        splashthread.IsBackground = false;
        splashthread.Start();
        Thread.Sleep(100); // Wait for the thread to start

I’m not fond of these voodoo sleeps (to say the least), so I’m looking for more nifty way of doing the above.

Any ideas?

  • 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-26T00:40:29+00:00Added an answer on May 26, 2026 at 12:40 am

    Something like this:

    var splashStart = new ManualResetEvent(false);
    
    var splashthread = new Thread(
      () =>
      {
         splashStart.Set();
         // Your thread code here...
      });
    
    splashthread.Start();
    splashStart.WaitOne();
    

    Don’t forget to Dipose splashStart or if it’s appropriate in your code use a using block.

    Edit: Didn’t confirm the original code in the IDE. Changed Wait to WaitOne() as per comment below.

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

Sidebar

Related Questions

I need to terminate a frozen thread, I set IsBackground as true but it
Why do we need to run the thread through start method and not directly
I need start off with code because I am not sure what terminology to
Normally to attach a debuger to a running jvm you would need start the
I need to start messing with a vb.net(vs2008) project file and I'd like a
I have a thread running but from outside I can't bypass a value to
I need to start and stop SQL Server from the command line. I am
I need to start developing in FORTRAN, any recommendations on learning\developing FORTRAN coming from
I need Week-Start-Date and Week-End-Date for particular Week number in a year (vb.net or
I need to start a Visual Basic script file by using WMI in 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.