ssylee wrote:
> Other than looking cleaner in the object oriented approach (each
> thread's main function in one class) vs. having UINT _ _stdcall
> ChildThread (void *args) {...} required declarations for Windows
> kernel calls, I'm not sure about the advantages of the first method
> compared to the second method. I'm not sure if I have given enough
> information on what I'm confused on, but any enlightenment would be
> much appreciated. Thanks.
Are you talking about detached threads vs a thread class ?
If you are, my experience is that if you want a process to exit cleanly,
it must close all it's threads before calling exit or returning from
main. Then the question becomes, how do you reliably manage that. I
have found that the "thread class" model where calling the destructor on
a class as an implicit join is sufficient and succinct. There are other
solutions as well but I think since threaded SW is harder to write,
keeping the options simpler is better.
That said, there are plenty of examples in the austria c++ unit tests of
using threads as a class.
http://austria.svn.sourceforge.net/v...=1&view=markup