Background Threads and UI refresh issue.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Background Threads and UI refresh issue.

  1. #1
    Join Date
    Jun 2011
    Posts
    2

    Background Threads and UI refresh issue.

    A C# development project (VS 2010), performing data collection with analog to digital device, on three 'channels'. Device requires polling so a background thread polls and buffers current device state into 3 List<>.
    UI, component moves desired List<> into strip chart component.
    This works well.

    UI contains TAB control, for user to context switch between the three lists/streams of data. Each tab page takes FOREVER to refresh/redraw. Even on form init. (which may be acceptable to stream buffering delays) but should not be present once app settles into load.
    Of interest is that while profiling application to identify possible bottleneck, app works perfectly?

    How should one properly instrument background threads.
    What is profiler introducing that would 'hide' this refresh delay.

    PS, there is one delegate/invoke from the worker thread back to the UI layer, which seems to take considerable time. All information says using this invocation approach is best soltution to having threads update UI controls.

    ALL Responses are appreciated and welcome.

  2. #2
    Join Date
    Jun 2011
    Posts
    2

    Re: Background Threads and UI refresh issue.

    I failed to mention that standard locking device is used to protect List<> between polling and UI. I assume it is this lock that may be blocking the UI, but would like to confirm before altering code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center