.net - How to simulate Control.Invoke() in two NON-UI threads -


  1. suppose there's thread ui thread.
  2. thread creates thread b non ui thread.
  3. when thread b wants raise event in thread has if(form1.invokerequired) form1.invoke(same method) , call event within same method right?

simple. question if want same thing if both , b non-ui threads? theres no form object call invoke() thread b.

if winforms apps why isn't there mechanism non-ui threads? missing something? there similar method raise event in 1 non-ui thread non-ui thread?

thanks in advance.

p.s. producer/consumer model answers not ones i'm looking here.

in first scenario, since thread b knows isn't ui thread, might call .invoke(...).

when there 2 non-ui threads, going have use kind of message passing / queue. can't interrupt thread run work; must code thread (for example) check queue work, dequeue item , execute it. pretty winforms does, courtesy of windows message loop. doesn't matter if isn't answer you're looking - is.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -