Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-26-2011, 03:22 PM   #1
LQ Newbie
Registered: Apr 2011
Posts: 1

Rep: Reputation: 0
Thread limits in dynamic libraries as opposed to static libraries

As a preface, I'm well aware that I'm attempting to create an unusually large number of threads. I work on a high performance algorithm that works best with huge numbers of threads running on high end hardware.

The issue I am seeing has to do with the number of threads I can have open at once on a 32-bit process running in a 64-bit Linux installation. I see the same exact behavior on both Ubuntu 10.10 and Red Hat Enterprise Linux 5.5.

In my testing, I create a statically linked function that creates threads using pthread_create() and a stack size of 16k. This test allows me to create slightly under 32k threads (varies upon the run) before I get a failure of type ENOMEM. However, if I copy/paste the same exact function into one of my shared libraries and call it, I am only able to create just under 512 threads (also varies slightly) before I get a failure code of EAGAIN. The failure of EAGAIN is very consistent and does not vary significantly with available memory resources.

Are there any specific limitations imposed by using shared libraries? The algorithm I use tends to peak at about 2-3k threads. To be able to set a parameter to work around this issue would be ideal.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
static and dynamic libraries nesta Programming 11 09-04-2011 09:36 PM
C/C++ library programming on Linux (Static and dynamic libraries) Marko-M Programming 1 04-10-2011 06:14 AM
Using dynamic libraries as static labraries n3wb Linux - General 3 05-12-2010 06:14 AM
Static libraries vs shared Libraries catallergy Linux - Newbie 2 03-16-2010 02:30 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:32 AM.

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