All pastes #748923 Raw Edit

Something

public text v1 · immutable
#748923 ·published 2007-10-25 08:59 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>


void *threa(void *data){

    while(1){
        sleep(1);
    }
}

int main(int argc, char *argv[])
{
    int count = 0;
    pthread_t p_thread;

    while(1){
        count++;
        if(pthread_create(&p_thread,NULL,threa,NULL) == -1){
            perror("thread create error");
            exit(0);
        }else{
            printf("Thread Create Sucess : %d\n", count);
        }
    }

    return 0;
}