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!
 
Back
Top