Subj : Problems with event raised from 2nd thread (C#) To : comp.programming.threads From : eastlands Date : Sat Jan 22 2005 04:47 am I have a standate WinForms application (C#) which needs to read and process data from a serial port. My UI runs on the standard thread but I start a new thread to read from the serial port and process the data received. When specific data is found by the serial-port-reading thread, an event is raised which is consumed by the main UI thread(?). This results in data being taken from the serial port class and the UI being updated. I know it is a BAD THING to allow the UI to be updated from 2ndary threads (but I'm not too clear on the reasons). I'm asking this question because the application is hanging so clearly I've broken some rules and caused a deadlock? Is the UI update done by the function consuming the event done on the 2ndary thread or the main UI thread? Any suggestions on how to rework this? I prefer to have the serial-port raise an event rather than a timer on the UI as there will be several screens that may want to process this data... Thanks, Stuart Eastland .