Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/10/2013, 07:52
numbersvj
 
Fecha de Ingreso: octubre-2013
Mensajes: 5
Antigüedad: 10 años, 7 meses
Puntos: 0
Problema con hebras posix

He estado toqueteando con hebras posix y estoy bastante perdido, no llego a entender el error de este código :/

Código PHP:
#include <iostream>
#include <pthread.h>

using namespace std;

unsigned long m=10;

double f (double x){
    return 
4.0/(1+x*x);
}

double calcula(){
    
double suma 0.0;
    for (
unsigned long i=i++)
            
suma += ((i+0.5)/m);
    return 
suma/m;
}

int main (){

    
pthread_t hebra1hebra2;

    
pthread_create (&hebra1NULL fNULL);
    
pthread_create (&hebra2NULLcalculaNULL);

    
pthread_join (hebra1,NULL);