ThreadTest was written to demonstrate bugs and inconsistent POSIX behavior that the Cygwin
emulation layer was displaying with regards to basic pthreads interface. ThreadTest is written
using pure C++ and fully POSIX compliant code, hence can be easily compiled and run on any
system that fully supports POSIX.
As far as any functionality is concerned ThreadTest really does nothing useful. All it does
is a series of stress tests, which are intended to break the Threading system of the OS or
VM its run on. It does this by creating several hundred threads, each doing a simple task of
tokenizing a string into its tokens and then getting the reverse and palindrome of each string.
Once the tokenization of the string is complete the thread will out-put to the stdout that it
has completed its task. A garbage collection thread cleans up the completed thread and then
creates a new thread to do exactly the same thing as the completed Thread. This cycle will continue
until the user SIG-INT or the set number of threads to be created is reached.
It is during this cycle that one may observe behavior that is non-compliant to POSIX from the OS's
threading infrastructure. The ThreadTest may crash, or may slow down, it may not respond to SIG-INT
or a variety of other problems such as zombie threads, accumalating thread handles, memory leaks etc...