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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:35:17+00:00 2026-05-23T08:35:17+00:00

Take this thread: Thread thread = new Thread(delegate() { //Code }); thread.Start(); Should it

  • 0

Take this thread:

Thread thread = new Thread(delegate()
            {
                //Code
            });

            thread.Start();

Should it be around the thread.Start(); or inside:

Thread thread = new Thread(delegate()
            {
                try
                {
                    //Code
                }
                catch (Exception)
                {
                    //Code
                }
            });
  • 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-23T08:35:18+00:00Added an answer on May 23, 2026 at 8:35 am

    it is completely different to put then inside or outside.

    If you put them around the thread.Start() call, you can detect (according to this page: http://msdn.microsoft.com/en-us/library/system.threading.thread.start(v=vs.71).aspx)

    • ThreadStateException The thread has already been started.
    • SecurityException The caller does not have the appropriate SecurityPermission.
    • OutOfMemoryException There is not enough memory available to start this thread.
    • NullReferenceException This method was invoked on a thread reference that is a null reference (Nothing in Visual Basic).

    If you put it inside, you will detect exception inside the code you will run in your thread. So any kind of exception you want.

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

Sidebar

Related Questions

I'm reading some data from a DB in an AsyncTask thread.... in this way:
In this question, octy wrote : BTW, if you save on a background thread,
I would like to use libev for a streaming server I am writing. This
I have a class like this: public FooRepo : IFooRepo { public FooRepo(IDbContextFactory factory)
I have a computation that can be divided into independent units and the way
I need to develop an app that is using multithreading. Basicly, I have a
I want to copy an existing MySQL table over to a duplicate table, but
I have a java server that sends some data through a socket to a
I'm parsing a large csv files - about 500 meg (many rows, many columns).
How would I have a default slideshow of thumbnails, like gallerific ! and when

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.