Tell another RUNNING thread to execute code

  • Thread starter Thread starter Tales Normando
  • Start date Start date
T

Tales Normando

Hi,

I'm working on a cybercafe management system that uses a
homemade messaging exchange system to communicate between the server and the
client softwares. Each one of the projects spawns another thread to wait
until a new message has arrived and process it. Some of the messages require
showing an user interface, like Messagebox.Show(). My problem is, I don't
want such calls to be executed on this thread, but on the main one. What
kind of options do I have to tell the other, running thread to execute a
subprogram/event ASAP?


Tales
 
Bubble an event up to your UI layer, your going to have to create a delegate
to execute on the other thread. (Maybe, you do if you mess with controls
from other threads, but odn't know).

Basically you build a bridge at the UI level to cross the communication over
to the other thread. It's fun!
 
Do you mean using Control.Invoke, Control.BeginInvoke and Control.EndInvoke?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top