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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:50:36+00:00 2026-05-17T15:50:36+00:00

I have a winform with a form called MainForm. I have a static class

  • 0

I have a winform with a form called MainForm.
I have a static class called ObjMgr.
In ObjMg, I have several other static classes, values, but Its not important now.

In the ObjMgr class, I also have a static void Pulse() method, that I populate my other static classes in the ObjMgr. This pulse method have to run very often, like 0,033 secs.

On MainForm I placed a start button, that on click event, starts pulsing my ObjMgr on another thread.

Pulser = new System.Threading.Thread(new System.Threading.ThreadStart(ObjMgr.StartPulsing));
Pulser.IsBackground = true;
Pulser.Start();

My ObjMgr.StartPulsing method source:

        while(true)
        {
            ObjMgr.Pulse();
            System.Threading.Thread.Sleep(30);
        }

My Pulser method source :

        //here I update all my data in ObjMgr
        // Its need to be fast, I have some while, and switch statements here.
        // complicated code here :D The main thing is, its populating my classes with data.

Now I have my pulser running , and keeping my static class data fresh.
Its very nice. Next step, I would like to show some data on my form (UI), from the updated ObjMgr classes. On my form I have about ~20 labels, 2 ProgressBar values, I want to update often, like the Pulsator. (0,033sec)

It would be obvious to update my labels, from the Pulsator method it self, but Iam afraid it would slow down my Pulsator, and I dont want it. So, I need some tips, how to do this thing. I was thinking, and I implented timer, that I set the interval to 30, then on tick event I read my data from the ObjMgr, and show modify the labels. It working okey, but little buggy, because some synchron problems. If you understand my problem could you give me some feedback, or tips how to make this better?

IF I would try to update my labels from the Pulse() method itself, would It slow my Pulse() method? If not, how could I update 20 labels on MainForm, from another 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-05-17T15:50:37+00:00Added an answer on May 17, 2026 at 3:50 pm

    Considering the timing criteria of your situation I would avoid initiating the UI updates from the worker thread. The reason is two fold. First, it is likely to have some impact on the timing characteristics of thread. Second, you would have to use an expensive marshaling operation (via Control.Invoke) to transfer the UI updating operation onto the UI thread.

    Your best bet in this situation is package all of the information needed to perform the UI update in a single class and then store it in a shared variable. Then have your UI thread poll this shared variable at an interval appropriate for you application.1

    This approach has several advantages.

    • The UI and worker threads remain loosly coupled as opposed to the Control.Invoke or Control.BeginInvoke approach which tightly couples them.
    • The UI thread will not impede the progress of the worker thread.
    • The worker thread cannot dominate the time the UI thread spends updating.
    • The intervals at which the UI and worker threads perform operations can remain independent.
    • The worker thread cannot overrun the UI thread’s message pump.

    1Updating the UI as quickly as you propose does not sound like a good idea. The UI is meant for human interaction and as such no human will care or even notice that it updates that quickly.

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

Sidebar

Related Questions

I have a WinForm project that contains a form called MainUI. You can see
In VB.NET, I have a Combobox on a WinForm form. The form allows the
I have a Winform with a BackgroundWorker. The BackgroundWorker, among other things, has to
I have a winform data entry and retrieval program called CaseNotes. This has a
I have a win form UI that looks like a typical calculator. Naturally I
In WinForms, I can design a form and have a TabValue to control which
I have a .NET 2.0 WinForms application with a ToolStrip on my main form.
I have a winform app that calls a web service to check for updates.
I have a Winform application built with C# and .Net 2.0. I have a
I have my winform application gathering data using databinding. Everything looks fine except that

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.