Original Post
Hi.
I am using multithread quite often now in my program when appropriate. According to Jeff Prosise, there are two simple ways of using multithreading correctly, especially worker threads.
-----
1: private HANDLE + duplicating thread handle upon instantiation
This solution make use of ::CloseThread(...)
2: private pointer to CWinThread + delete private member
This solution requires setting thread autodelete to FALSE and deleting thread manually.
-----
Right now, I am using solution #2. The reason is I would know the thread is really gone because I delete, not MFC. Nonetheless, I have seen developers use both. Jeffrey Richter uses solution #1 in his book, Programming Applications for Microsoft Windows (Dv-Mps General).
Are there advantages one solution has over the other?
Thanks,
Kuphryn