views:

12

answers:

1

hello there I am trying to code a simple application which would help me in reading from a serial port and write to the same serial port using a single thread ...so could someone please help me to manage the synchronization between the threads.heres the source code- the whole project file in Visual studio 6 - http://rapidshare.com/files/406340281/SerialPortTest.rar

Thanks

Sayonee

A: 

The easiest way to add synchronization is to use a CRITICAL_SECTION.

Try to find variables/functions/... that shouldn't be set/executed at the same time and protect them using a critical section.

Patrick