Starting a thread

When your application creates a thread, the system initializes a thread object, control structures, and runtime support. These allow the new thread to use language constructs and system services safely.

In addition, you might need to initialize the application data and parameters that the new thread uses before starting the new thread.

When you create a thread, the system assigns the thread a unique thread identifier. The thread identifier is an integer value that you can use when you debug, trace, or perform other administrative activities on the thread. You typically do not use this thread identifier to directly manipulate the thread.

Most APIs that create a thread return a thread object or handle that represents the newly created thread. You can use this thread object to manipulate the new thread, or use this thread object as a synchronization object to wait for the thread to finish its processing.