LinuxQuestions.org
Review your favorite Linux distribution.
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


Reply
  Search this Thread
Old 10-16-2003, 01:03 AM   #1
brianvdc
LQ Newbie
 
Registered: Feb 2003
Location: Hillsboro, OR
Posts: 13

Rep: Reputation: 0
Boost threading


I am using boost to create several threads. Redhat Linux has a limit of 256 threads per process at a time. Even though my threads are exiting, I am unable to create more than 255 threads.

In the past when I used pthread_create (which I assume boost is using internally), I had to create the thread "detached" or the resources would never clean up and even if the thread exited I would never be able to create more than 255 threads.

I am assuming this is a similar problem, but do not see anywhere in the documentation on how to create the threads detached or how to detach them after creation.

Any help would be appreciated.

Brian
 
Old 10-16-2003, 04:12 AM   #2
Kumar
Member
 
Registered: Sep 2003
Location: Pune, India
Distribution: Red Hat
Posts: 106

Rep: Reputation: 15
Use pthread_detach() to detach the thread. Resouces allocated to a detached thread is automatically deallocated once the thread terminates. A thread can be created initially in the detached state by setting attributes in pthread_create. see man pthread_detach for more info. use pthread_join() to free the resources.

Last edited by Kumar; 10-16-2003 at 04:15 AM.
 
  


Reply



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
Problems with boost nathacof Programming 10 11-04-2005 12:56 PM
g++ and boost problem mixx Programming 1 07-20-2005 12:53 PM
how to install Boost 1.3.20 chutsu Linux - Software 0 11-10-2004 02:22 PM
Installing Boost for Kahakai chutsu Linux - Software 3 11-09-2004 02:22 PM
bass boost with sox mtb Linux - Software 2 08-22-2004 04:23 AM

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

All times are GMT -5. The time now is 02:05 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