Threading

02/20/2013 21:44 szymek111#1
Hi!I have a question for what i need multithreading i developing game server.Soo i know that i need this for connection.
02/21/2013 12:41 Mr.Zoey#3
Use this funktion:

Code:
#include <iostream>
#include <process.h>

using namespace std;

void myFunction( void* number){
     
     int myNumber = *(int*)number;

     cout << "Theard Id" << myNumber << "\n";
          
     _endthread();

}

int main(int argc, char *argv[])
{
    int tempNum[10];

    for( int i = 0; i <= 9; i++){
         tempNum[i] = i;
         _beginthread( myFunction, 0, (void*)&tempNum[i]);
    }
    
    system("PAUSE");
    return 0;
}
This Funktion Working !!!
02/22/2013 08:08 ernilos#4
Lib: procces.h
Functions: _beginthread(...,...,...) & _endthread()