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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:22:13+00:00 2026-05-16T12:22:13+00:00

At work we’ve got a very CPU-intensive Windows Forms application. It’s running on a

  • 0

At work we’ve got a very CPU-intensive Windows Forms application. It’s running on a server with 24 cores.

As the Windows Forms model involves a single GUI thread processing a message pump, it seems that a rich, complex GUI is not making good use of the capabilities of the system. Am I wrong in saying this?

So my coworkers were discussing this. Our application just happens to involve two more-or-less independent forms. The idea came up to have the auxiliary form operate on its own dedicated thread, freeing up the app’s main GUI thread to only process messages sent to the main form.

Presumably this would look something rather like this:

void CreateAuxiliaryForm()
{
    Action displayForm = () =>
    {
        var f = new AuxiliaryForm();
        f.ShowDialog();
    };

    displayForm.BeginInvoke(displayForm.EndInvoke, null);
}

Now, first of all, I don’t know if this is safe to do at all. But my thinking is that since the two forms will be independent, it really ought to be OK for each one to have its own thread. Is this true?

I did say “more-or-less,” and that’s because I can’t really say the two forms have no interaction whatsoever. But what my coworkers and I figured was that in any scenario in which the main form has to interact with the auxiliary form in some way (say by one handling an event raised by the other), we would simply need to be sure to use Invoke/BeginInvoke to send any GUI-related code to the appropriate message pump.

What are people’s thoughts on this idea?

  • 1 1 Answer
  • 1 View
  • 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-16T12:22:14+00:00Added an answer on May 16, 2026 at 12:22 pm

    Generally: Don’t.

    There are few possible reasons where threading the UI might help:

    • You are blocking the foreground thread for significant times (say > 5s) after a user action
    • You are blocking for notable time spans (>~300..500ms) not triggered by the user (e.g. through a periodic timer)
    • You have really expensive updates (rendering full-screen charts) and expect a dozen of these forms active.

    Otherwise, there is no point, even for a “UI from hell” with hundreds of buttons and controls.

    The only performance requirement for the UI is that it’s smooth, meaning the user perceives UI responses to his actions as “instant” – which, for most actions is is 100..300ms (depending on the frequency of the action and the “size” of the response).

    The downsides are many. WinForms is built on top of Win32 GUI, where threading “kinda works for top-level forms”, but takes some care to get right. Internet Explorer uses spearate processes even, and some addins still manage to bring down all tabs when one page hangs.

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

Sidebar

Related Questions

Work on C# Desktop project,I have an account on paypal ,From my desktop application
work on SQL Server 2000. want to Automated Email Notifications using SQL Server Job
Work on this small test application to learn threading/locking. I have the following code,
At work our end-users are on Windows XP and using Outlook Express. Whenever a
Work got in the way of learning Objective C but i'm back at it
I work directly on a remote (S)FTP Server some times. I use textmate as
Work on C#, in one of my application I need to get the SQL
Work on C#.In my application several time need to select\collect datafrom DB.Fro this task
work on Sql server 2000. i want to get the current server date and
I work for a very large organization that is looking for new ideas. Currently

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.