//
//panda
//2011-12-1
//
// 多线程设计
//
#include<Windows.h>
#include<process.h>
#include<iostream>
using namespace std;
//
//first thread function
void FirstThread(void * param)
{
while(true)
{
cout<<"first thread."<<endl;
Sleep(1000L);
}
}
//
//second thread function
void SecondThread(void * param)
{
while(true)
{
cout<<"second thread."<<endl;
Sleep(1000L);
}
}
//thrid thread
void ThridThread(void * param)
{
while(true)
{
cout<<"thrid thread."<<endl;
Sleep(1000L);
}
}
int main()
{
cout<<"start two thread:"<<endl;
_beginthread(FirstThread,0,NULL);
_beginthread(SecondThread,0,NULL);
_beginthread(ThridThread,0,NULL);
system("pause");
return 0;
}