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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:12:40+00:00 2026-05-27T02:12:40+00:00

i have a need to invoke some methods asynchrounously. On startup, the app does

  • 0

i have a need to invoke some methods asynchrounously. On startup, the app does some work on initializing a few things but I don’t want the UI to be held up. So, this function is performed in a separate thread using Threadpool queueitem method.

I was thinking to have a few methods similar to below.

protected void Page_Load(object sender, EventArgs e)
{
    DoAsyncOperation(new Func<string, int>(TestMethod), "test");
}

private int TestMethod(string p)
{
    return 0;
}

public bool DoAsyncOperation(Delegate asyncMethod, params object[] args)
{
    return ThreadPool.QueueUserWorkItem( delegate {asyncMethod.DynamicInvoke(args);});
} 

so that in future other methods can also be run async if needed and its all in one place. If I have to change logic for the threading, I can do it in a single method.

Is there any performance issues with this approach, passing in the method dynamically?

  • 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-27T02:12:41+00:00Added an answer on May 27, 2026 at 2:12 am

    As always: “Profile Profile Profile“! That said, in this case I’d be fairly sure to say:

    No not at all at this scale, it doesn’t matter:

    The actual time spent loading the page or even managing the Queue far outweighs the invocation overhead of a delegate (even if it uses DynamicInvoke under the hood)

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

Sidebar

Related Questions

The title pretty much says it. I have some methods that need to run
I have a list of callback functions that I need to invoke when an
I have a C# .NET 2.0 CF project where I need to invoke a
I have a web user control which call some methods of an interface. Four
I have NSTableView object. I need to invoke the menu associated with it at
Need some help with below issue We have 2 machines, each of these machines
I want to use some DevicePolicyManager methods in my app. The DevicePolicyManager was introduced
I have an iPhone application which has some methods to gather information from the
I have a need to create a HttpSession (via cookie) whenever a client invokes
We have need for a rating system in a project we are working on,

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.