|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Send a message to a threadHi
Is there any method to send a message to a running thread so the thread will perform a specific function before the program suspends it? Thank you, Shmuel Shulman Shmuel,
Yes. But, the thread must be implemented specifically for that type of behavior. To create your own thread that does this you need to have it run an infinite loop that waits for an object to appear in a queue. When an object appears the thread wakes up and processes that object accordingly. Other threads have access to the queue so that they can enqueue objects at any time. UI threads behave this way because they run a windows message pump. Other threads can instruct the UI thread to run some function by using Control.Invoke. Invoke takes a delegate as a parameter and posts a message to the UI thread's message queue instructing it to execute the specified delegate. Brian S Shulman wrote: Show quoteHide quote > Hi > > Is there any method to send a message to a running thread so the > thread will perform a specific function before the program > suspends it? > > Thank you, > Shmuel Shulman
Hashtable question
Simple LookupAccountName (working) guidelines for developing an application How do you protect from pirating? Object variable or With block variable not set. SQL Error How can I get the following functionatilty in Windows Forms ? Anyone know what could cause the following error messages? Avoiding late binding Print information when ANY control is used |
|||||||||||||||||||||||