Programación de procesos de Windows
dword winapi suma hilo(lpvoid LP)//Suma hilo
{
int * sum =(int *)LP;
for(int I = 1;ilt101;i)
{
(* suma) = I;
}
Regresar 0; //Retorno del hilo
}
dword winapi multhread(lpvoid LP)//Hilo factorial
{
int * mul =(int *)LP;
for(int I = 1;ilt11;i)
{
(* mul)* = I ; p>
}
Devuelve 0;
}
Hilo de impresión Dword winapi (lpvoid LP)//hilo de impresión
{
Manejador;
int suma = 0;
int mul = 1;
handle = CreateThread(NULL, NULL, SumThread, (LPVOID) amp; sum, NULL, NULL); //Crear un hilo de suma
CloseHandle(handle); //Cerrar el identificador del hilo
handle = CreateThread(NULL) , NULL, MulThread, (LPVOID) & mul, NULL, NULL); //Crear hilo factorial
CloseHandle(handle); //Cerrar el identificador del hilo
printf ("d) ",sum); //Imprimir y
printf("d",mul); //Imprimir factorial
Devuelve 0;
}
void main()
{
Manejar identificador;
handle = CreateThread(NULL, NULL, PrintThread, NULL, NULL, NULL);
CerrarHandle(identificador);
}