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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:42:09+00:00 2026-06-04T19:42:09+00:00

My question may not really be about realtime processing, but then again, it may

  • 0

My question may not really be about realtime processing, but then again, it may be.

My application has several threads that are far more important than the GUI, BUT, I do want the GUI to at least be usable. I don’t want it locked at all times, and I do want to update the screen given results of processing I am performing.

Currently all my essential items are isolated in separate threads, and I call a delegate to my GUI to display results.

My GUI works, but if I change tabs, or minimize/maximize it, it has been known to hinder my other threads to the point where they can not perform their operations within the 0.1s time limit they are held to.

This is what I am doing to call my delegate:

delegate void FuncDelegate(ResultContainer Result);
FuncDelegate DelegatedDisplay= new FuncDelegate(DisplayResults);
//then later on
Invoke(DelegatedDisplay, Result);

Most of my critical processes are threads that run in continuous loops, pulling from and pushing to various buffers (ArrayLists and normal Lists).

One of my critical threads is launched every time, using:

Thread mythread = new Thread(new ThreadStart(ProcessResults));
mythread.Start();

The reason I thought to do this, instead of just having a thread running in a loop, pulling from lists, is that I thought perhaps the reason I was running out of clock time was that I have a polling loop that I worry consumes too many resources (although I am using Thread.Sleep(5) every time the poll turns up negative).

Does launching a new thread each time I need the concurrent process cost me valuable time? Should this be a loop? Are my loops to blame?

Can I give a thread higher priority than others, or is the use of Thread.Sleep my only option? If I do assign higher thread priorities, how can I be sure other threads can even survive?

Why are simple forms events hampering my other threads so much? Is there a way to give my GUI thread an assigned, lower amount of resources? Can I use a Thread.Sleep somehow to block Form events if the other threads are running out of clock time?

Short of an answer to all my frustrating questions, is there some kind of thread profiler I can be using to help figure my mess out? I tried using “Managed Stack Explorer” but somehow that doesn’t always show what threads my application has.

Any help on this matter would help me greatly.

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

    Well here’s a start:

    Invoke(DelegatedDisplay, Result);
    

    This means that you are causing the background thread to wait until the UI thread actually performs the drawing operation, then proceed. From the thread’s point of view that’s an eternity. You might want to investigate asynchronous updates to the UI:

    BeginInvoke(DelegatedDisplay, Result);
    

    That’s equivalent to telling the UI thread “when you have a chance, perform this drawing action”, then proceeding with the work that you were doing.

    You should be aware that this may cause thread-safety issues that didn’t occur using Invoke, though. For example, if the background thread is still modifying Result while the UI is attempting to draw, you might have unexpected race conditions.

    See Control.Invoke vs Control.BeginInvoke

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

Sidebar

Related Questions

I concede that this question may fall into the 'discussable' but not 'answerable' category.
It may not be a pure programming question but I'm looking for information about
That may seem like a broad question, but I'm talking specifically here about apps
This question may not directly relate to programming. I have noticed that the technology
This may not be a programming question, but I don't know where to ask
This may not be the kind of question one should ask on StackOverflow, but
I think my question may be a duplicate, but I do not know what
Sorry, this may or may not be a programming question directly, but I am
I know this is a total newbie question, but the answer may not be
I have an ASP.NET website, but this question isn't really about technology, it is

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.