[2.0] Threads sharing a variable
I've got 2 threads, one deals with the UI the other adds stuff to a Queue variable. I want to get the UI thread to do stuff whenever the other thread adds to the queue.
I've searched and searched, but i'm not sure what i can do. I think in .NET 1.0/1.1 there was a CallBack variable which could be used to call a method in another thread, but it seems to have gone in 2.0
I've looked into raising an even in the UI thread, but i'm just not sure quite how to do it.
Any help or simple example would be greatly appreciated! :)
Re: [2.0] Threads sharing a variable
You would define a method that raises your event and then you would invoke it from the other thread using a delegate. A forum search should turn up examples of doing so. if not, check out the help topic for the Control.Invoke method.
[RESOLVED] Re: [2.0] Threads sharing a variable
Thanks for your help, i managed to find a few relevent threads, knowing what i was looking for. :)