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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:29:31+00:00 2026-05-17T00:29:31+00:00

I have a fairly long parallel foreach loop I need to run. Over 100

  • 0

I have a fairly long parallel foreach loop I need to run. Over 100 computers on the network will be accessed and each operation on each computer will take a few seconds. Parallel foreach loops seem like the perfect solution for this to speed up the process.

What visual clues have you been able to come up with that will make it easy for the user to see the progress of the loop? Obviously because it is mutli-threaded updating the GUI is expensive and risky, so my question is what other Visual indicators can be used to show progress?

  • 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-17T00:29:31+00:00Added an answer on May 17, 2026 at 12:29 am

    Well you shouldn’t directly update the UI thread from the background code, but you can certainly consider updating some shared piece of memory to communicate progress.

    As a really simple example, if your code can be treated as a series of repeated steps, you can just increment a counter. The Interlocked.Increment() method is particularly helpful for this purpose, as it does so without requiring a lock. Your UI thread could then periodically poll this counter and report it’s value – or visualize it if possible (as perhaps a progress bar or running average).

    If multiple machines are involved, it may make sense to keep a counter per machine and report on how the overall task is progressing across participating peers. You could also consider visualizing the average elapsed time between completed steps … which may help users of the system estimate the time to completion (and you could perhaps compute this as well).

    More complex implementation are also possible. You could, for instance, creating a shared queue to which you post logging information or per-activity statuses. This can get pretty complicated … and if implemented poorly could have an adverse affect on performance.

    Alternatively, if you want to collect a significant number of performance metrics about your distributed process, you could consider using the Performance Counters API in System.Diagnostics. This is a more complicated path – but it allows you to leverage the high-performance metric collection and publishing implementation in the OS and allows you to observe and aggregate performance information using a tool like Perfmon.

    The specific mechanisms you use to update the UI depend on what technology you are using (WPF, WinForms, HTML) and whether the distributed code and the UI code have any components co-located within a single process. If the distributed/UI portions are not hosted within a single process, you will likely need to use some form of IPC to communicate and visualize progress.

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

Sidebar

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.