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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:39:59+00:00 2026-06-09T20:39:59+00:00

Suppose I have a WPF application where I have the following architecture: [Worker Thread]

  • 0

Suppose I have a WPF application where I have the following architecture:

[Worker Thread] -> [Queue 1] -> [Queue Manager Thread] -> [Queue 2] -> [UI Thread]

The Worker is listening to data from some service and receives that data at indeterminate times (could be multiple times per second or a few times every few seconds) then queues it to Queue 1, then the Queue Manager, depending on the “health” of the UI thread may decide to throttle up / down the rate that data items are queued to Queue 2, which the UI thread uses to update the UI, maybe dropping a few items, so as not to overwhelm the UI thread in the event it is receiving too many messages (eg it might decide that it will check the timestamp of each data message and only enqueue it to Queue 2 if the difference between messages is at least 5 seconds older than the last data item the UI updated itself with)

The UI thread will have a timer that fires a set-interval to update the UI with new data from Queue 2. What I’d like to be able to do is determine how fast the UI is updating itself to measure it’s “responsiveness” in order to throttle eg increase / decrease the timer-interval as to how often to update the UI

Suppose my UI had lots of controls (grids, charts etc) all bound to different filtered / grouped subsets of the data on Queue 2 in my UI shell and the UI starts becoming unresponsive and freeze between updates when updating those controls, how could I detect this from code in order to know how / when to increase / decrease the interval for UI updates? Basically, how do I measure how long it takes to rebind the entire UI across all controls bound to the data?

BTW is this a good design or could it be improved? Are there any other strategies I could consider?

  • 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-09T20:40:01+00:00Added an answer on June 9, 2026 at 8:40 pm

    I would simply drop the QueueManager and Queue2.

    All you need is a WPF Dispatcher Timer (and not a Timers.Timer) that checks for input every few ms. You can statically configure that timeout.
    And then make Queue1 a blocking queue to throttle whatever is upstream.

    Edit

    The Dispatcher Timer can be started with a certain priority. Pick a low one, like Background or ContextIdle and you will never overload the GUI.
    Then just make sure the Timer doesn’t bite off more than it can chew. Only 1 (or a few) items at a time. Tune this part so that the GUI will process as much as it can but no more. The runtime adjustment comes for free because you’re tied into the dispatcher.

    And (only when needed) you can use Queue1 = new BlockingCollection<MyItemType>(MaxItems) so that this queue doesn’t overfill.

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

Sidebar

Related Questions

I have a WPF application using service references to a WCF service. When doing
I have a richtextbox control in my WPF 4.0 application. Now suppose I have
Suppose we have a WPF element, for instance StackPanel with Buttons, Textboxes etc. inside.
Suppose I have a class Baz that inherits from classes Foo and Bar ,
Suppose I have two tables, - emp(empId number(1),empName varchar2(50)) and - manager(manId number(5),managerName varchar2(100))
I am creating an application using WPF which is using Prism framework. I have
I have a custom control derived from Button: class MyControl : Button{} And suppose,
I have a C#/WPF application with a tabbed interface that has been behaving strangely.
I have a C# WPF application with a web browser control (System.Windows.Controls.WebBrowser) called wB.
i have wpf application, a game of sudoku. I have a model and user

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.