C# Events between threads executed in their own thread (How to) ?

Posted by Guillaume on Stack Overflow See other posts from Stack Overflow or by Guillaume
Published on 2010-03-08T19:12:09Z Indexed on 2010/03/08 19:21 UTC
Read the original article Hit count: 149

Filed under:
|
|
|

Hello,

I'd like to have two Threads. Let's call them :

  • Thread A
  • Thread B

Thread A fires an event and thread B listen to this event. When the Thread B Event Listener is executed, it's executed with the Thread A's thread ID, so i guess it is executed within the Thread A.

What I'd like to do is be able to fire event to Thread B saying something like: "hey, a data is ready for you, you can deal with it now". This event must be executed in its own Thread because it uses things that only him can access (like UI controls).

How can I do that ?

Thank you for you help.

© Stack Overflow or respective owner

Related posts about c#

Related posts about events