pthread Creation failing
Hi all
i have a small program written something lke this.
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
void *dummy(void *arg)
{
}
int main()
{
pthread_t tid;
int i=0
while(i<1024)
{
pthread_create(&tid, NULL,&dummy, NULL)
i++;
printf("i = %d\n", i);
pthread_exit(tid);
}
}
In this i am creating a thread and exiting the thread also.
After 1024 times i am getting error in creating the thread with ernno as 12 --ERRNOMEM.
why is this happenning??
can any one help me?
Thanks in advance
Arun KA
|