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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:03:57+00:00 2026-06-04T21:03:57+00:00

How do I make GUI events yield to a given thread? By GUI events

  • 0

How do I make GUI events yield to a given thread? By GUI events I mean things like opening a sub-form, selecting different tabs, or minimizing/maximizing my form or changing focus.

When my working thread gets data, can I throttle resources over to it, and deny those resources from other processes or threads in my application?

History:
In my question Here I explain a scenario where I am concerned with my Invoke to my main form causing hang-ups on my critical threads. It was then revealed to me that I have the option to “BeginInvoke”.

Now I find that while BeginInvoke gets me half-way there, I’m still unable to avoid hang-ups in my critical threads. When I say “critical threads” I am refering to a thread that takes approximately 60ms to cycle, but must finish cycling before 130ms has elapsed. It sits there looping, polling a data list. When the data shows up, it generally takes between 40 and 60ms to finish processing.

I had (and technically, I plan to reinstate) a second thread throwing BeginInvokes at my form to update the user on the status of the run. I currently, for debugging purposes, am not doing that.

I did some profiling, and I noticed that I almost always keep my process time down far below 100ms, which I need to be, because my application needs to output results no later than when the next package of data appears (every 100ms, but for this example I slowed that to 130ms). When I interact with my form, by say changing focus, or minimizing/maximizing it, I can see my process time spike above 1s. I assume this is because silly things like minimizing or maximizing, or other re-draw events, are plundering all my precious clock time.

Platform:
I am using Visual C# 2008 with WinForms. The target machine runs Windows XP. I have attempted closing Windows Explorer, and running my application on Normal, High, and Realtime, priority, but I still see a nearly identical impact when manipulating my form.

Edit
I have tried to use Thread.CurrentThread.Priority to throttle my priority at critical times during my worker loop. This somehow isn’t able to take those resources away from my GUI and operations that involve redrawing the GUI still rule over my poor worker thread.

  • 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-04T21:04:00+00:00Added an answer on June 4, 2026 at 9:04 pm

    Did you try and set the Thread Priority of your worker class to RealTime using the Thread.Priority property?

    Based on the description of Scheduling Priorities this should give a higher priority to your worker thread. However, this will cause your GUI to stutter along, so you probably only want to set the priority high during critical time periods.

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

Sidebar

Related Questions

I am trying to learn to use the wx packages to make GUI programs
I want to make some GUI mockup program for video player, so my idea
I want to make basic gui-tests with the ms ui automation framework, therefore i'm
I want to make a gui for what i explained here C# visual control
SUMMARY How can I make my GUI application run on windows startup on a
I am trying to make a gui with Glade 3 (gtk) and ruby but
I'm trying to make a GUI program with the Android SDK, using their Lunar
I am going to make a GUI that will have dynamically created sets of
Hey guys I'm trying to make a GUI which can navigate through JTextAreas when
I'm dying to know how I can make a GUI for ffmpeg and jhead

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.