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