static SerialPort port = new SerialPort("COM3", 57600, Parity.None, 8, StopBits.One);
thread1()
{
lock(port)
for(;;)
port.write"Hi 1";
}
thread2()
{
lock(port)
for(;;)
port.write"Hi 2"
}
output:(in Hyper-Terminal)
Hi 1
Hi 1
Hi 1
here as thread1 is locked and is in a infinite loop, so its not coming out of thread1 at all.. but i need thread1 and thread2 to print simultaneously.. Please help me out.
Thanks.