Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello there I am trying to code(VISUAL C++ 6) 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 http://rapidshare.com/files/406340281/SerialPortTest.rar
Thanks
Sayonee

[edit]Don't shout - it is rude and unnecessary. Tags changed. - OriginalGriff[/edit]
Posted
Updated 11-Jul-10 3:52am
v3
Comments
OriginalGriff 11-Jul-10 9:54am    
Don't shout.
It is very unlikely that your Rapidshare link will be followed: Most work filters block rapidshare, and very view of us will download an unknown RAR file anyway. Instead, post relevant code fragments in your original question, using the "code block" widget to preserve the formatting.
Rajasekharan Vengalil 12-Jul-10 17:27pm    
If there's only a single thread what is there to synchronize? Or do you mean a single thread in addition to the main thread? Also, as "OriginalGriff" mentioned, please post code fragments. The question is just more likely to be answered then.

1 solution

XML
If you write MFC code, I think the simplest way is to use AfxBeginThread to create your work thread, if you want to both reading and writing data to a same port, you can use <pre lang="C++">CCriticalSection</pre>
, CEvent, CMutex or <pre lang="C++">CSemaphore</pre>
if you choose CEvent, you can use <pre lang="C++">WaitForSingleObject</pre>
to wait your CEvent object
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900