Thread is an easy process. A thread can be freely defined as a separate thread of execution that occurs simultaneously and independently of everything else that can happen. A thread is like a classic program that starts at point A and runs until it reaches point B. There is no event loop in it. A thread works regardless of everything that happens on the computer. Without threads, an entire program can be supported by one intense CPU task or one infinite loop, intentionally or otherwise. In threads, other tasks that do not get stuck in the loop can continue processing without waiting for the stuck task to complete. Please follow this link for more information and its comparison with the process.
http://en.wikipedia.org/wiki/Thread_(computer_science)
, ....
, i.e ThreadFun1
#include<windows.h>
#include<stdio.h>
#include<conio.h>
void __stdcall ThreadFun1()
{
printf("Hi This is my first thread.\n");
}
void main()
{
printf("Entered In Main\n");
HANDLE hThread;
DWORD threadID;
hThread = CreateThread(NULL,
0,
ThreadFun1,
NULL,
0,
&threadID);
printf("Other business in Main\n");
printf("Main is exiting\n");
CloseHandle(hThread);
getch();
}