LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 07-18-2006, 12:28 PM   #1
arunka
Member
 
Registered: Mar 2005
Posts: 60

Rep: Reputation: 15
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
 
Old 07-18-2006, 12:34 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread Creation failing arunka Programming 1 07-18-2006 03:27 PM
pthread creation problem oulevon Programming 2 04-24-2006 04:59 AM
eth1 failing on boot, IEEE firewire card driver failing, help jackuss_169 Linux - Laptop and Netbook 5 03-05-2005 07:34 AM
LILO install failing, Boot failing, but Installation fine. sramelyk Slackware 9 08-23-2003 02:37 PM
X failing to load; AddScreen/InitScreen failing for driver 0 weblion Linux - Software 1 08-01-2002 06:14 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration