LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 04-26-2011, 02:22 PM   #1
pmkenny1234
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.
 
  


Reply


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


All times are GMT -5. The time now is 06:03 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration