c# - StackOverflowException in multi-threaded UI update application -


i have application bunch of jobs off working (await task.whenall...) , updating progress section of form.

i've noticed when running particularly fast (e.g. when there not processing do, checks), i'm getting following exception thrown:

stackoverflowexception updating label text

the invokerequired helper method 1 found on site while ago , looks this:

    internal static void invokeifrequired<t>(this t control, action<t> action)         t : isynchronizeinvoke     {         if (control.invokerequired)         {             control.invoke(new action(() => action(control)), null);         }         else         {             action(control);         }     } 

could tell me why assigning label text value causing stackoverflowexception please?

edit: here detail of exception

thread error

there 2 situations:

  • you requests workflow update info , breaks application - in case need known 'debouncing' - when request don't execute update set timer let's 200 ms , cancel previous timer , timer executes update, way ensure update can't happen more once in 200 ms won't break app. can more complicated if new requests in less 200ms long periods of time, need implement logic update , not trigger timer.
  • you have circular reference causing code execute multiple times (but if case exceptions always) - can check using debugger , checking stack calls problematic code.

Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -