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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:01:22+00:00 2026-06-12T09:01:22+00:00

i want to configure my Thread to be background thread, why this property missing

  • 0

i want to configure my Thread to be background thread, why this property missing in my Thread ?

    ThreadStart starter = delegate { openAdapterForStatistics(_device); };
    new Thread(starter).Start();

public void openAdapterForStatistics(PacketDevice selectedOutputDevice)
{
    using (PacketCommunicator statCommunicator = selectedOutputDevice.Open(100, PacketDeviceOpenAttributes.Promiscuous, 1000)) //open the output adapter
    {
        statCommunicator.Mode = PacketCommunicatorMode.Statistics; //put the interface in statstics mode                
        statCommunicator.ReceiveStatistics(0, statisticsHandler);

    }
}

i have try:

Thread thread = new Thread(openAdapterForStatistics(_device));

but i have got 2 compilation errors:

  1. The best overloaded method match for ‘System.Threading.Thread.Thread(System.Threading.ThreadStart)’ has some invalid arguments
  2. Argument 1: cannot convert from ‘void’ to ‘System.Threading.ThreadStart’

and i don’t know why

  • 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-06-12T09:01:22+00:00Added an answer on June 12, 2026 at 9:01 am

    About the background thing, I don’t see how you expect to set it since you’re not keeping a reference to the thread. Should look like this:

    ThreadStart starter = delegate { openAdapterForStatistics(_device); };
    Thread t = new Thread(starter);
    t.IsBackground = true;
    t.Start();
    

    This

    Thread thread = new Thread(openAdapterForStatistics(_device));
    

    won’t work because you’re supposed to pass in a method that takes object as parameter, while you’re actually passing the result of a method call. So you could do this:

    public void openAdapterForStatistics(object param)
    {
        PacketDevice selectedOutputDevice = (PacketDevice)param;
        using (PacketCommunicator statCommunicator = selectedOutputDevice.Open(100, PacketDeviceOpenAttributes.Promiscuous, 1000)) //open the output adapter
        {
            statCommunicator.Mode = PacketCommunicatorMode.Statistics; //put the interface in statstics mode                
            statCommunicator.ReceiveStatistics(0, statisticsHandler);
    
        }
    }
    

    and:

    Thread t = new Thread(openAdapterForStatistics);
    t.IsBackground = true;
    t.Start(_device);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new xunit and want to configure the test flow using xunit. For example,
I've hired a new VPS and have root access. Now i want to configure
I am new to tcl. I want to create a thread in tcl which
I have a need to start a new thread for a long running task
I want to create a background thread on the iPhone that executes some code
i want to configure tomcat 7 to use port 80 on windows 7, but
I want to configure my log4j logging to not log messages that are 1)
I want to configure the tree view component so that would be the topmost
I have an xml file that I want to configure using a bash script.
For the first time i use eclipse with m2e and i want to configure

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.