"Sin Jeong-hun" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm writing an Windows application that processes inputs from a serial
> port. The serial port data is processed when DataReceived event occurs
> from the SerialPort instance. If the DataReceived event handler and
> the MainForm are in the same thread, and the user is calling a method
> in the Mainform which possibly take a few seconds, and if data is
> received at that time, I worry that event might not be handled. So I
> want to run serial port handler class in a separate thread but all I
> know is to run a method as a thread.
You actually don't want to really use custom threads for this - you're
better off using Asynchronous I/O.
If you poke around the methods that you're calling, you'll find a
"BeginRead(..)" method in there. Look that up in the help, and figure out
how to take advantage of it. That's really the best way for you to be doing
I/O from the Serial Port...
--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins