Increasing the max pthreads supported

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Increasing the max pthreads supported

Ed Hourigan
Message
I have a legacy application which uses a lot of threads ( its designer used thread pools ).  I am try to run valgrind 2.4.0 to check for memory leaks.
The default pthread count limit of 100 is not suffcient for this application ( The VG_N_THREADS constant ).  So I increased VG_N_THREADS to 200 and
re-build valgrind.  Now when I run, pthread_create returns an error - errno is set to "Insuffcient Memory" (or something like that).  Anyway, I was wondering
if I had to increase some other constant if I increase VG_N_THREADS?  Its seems that I can only create 110 threads before I get the pthread_create to fail.
 
System:
Linux 2.6.10 kernel
Fedora Core 2 distribution
 
Thank you.
 

Reply | Threaded
Open this post in threaded view
|

Re: Increasing the max pthreads supported

njn (Bugzilla)-2
On Fri, 10 Jun 2005, Ed Hourigan wrote:

> I have a legacy application which uses a lot of threads ( its designer
> used thread pools ).  I am try to run valgrind 2.4.0 to check for memory
> leaks.
> The default pthread count limit of 100 is not suffcient for this
> application ( The VG_N_THREADS constant ).  So I increased VG_N_THREADS
> to 200 and
> re-build valgrind.  Now when I run, pthread_create returns an error -
> errno is set to "Insuffcient Memory" (or something like that).  Anyway,
> I was wondering
> if I had to increase some other constant if I increase VG_N_THREADS?
> Its seems that I can only create 110 threads before I get the
> pthread_create to fail.

AFAIK increasing VG_N_THREADS should be enough.  Can you provide us with
a test case program?

Nick


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|

Re: Increasing the max pthreads supported

Beorn Johnson
In reply to this post by Ed Hourigan
> > The default pthread count limit of 100 is not suffcient for this
> > application ( The VG_N_THREADS constant ).  So I increased VG_N_THREADS
> > to 200 and
> > re-build valgrind.  Now when I run, pthread_create returns an error -
> > errno is set to "Insuffcient Memory" (or something like that).  Anyway,
> > I was wondering
> > if I had to increase some other constant if I increase VG_N_THREADS?
> > Its seems that I can only create 110 threads before I get the
> > pthread_create to fail.

I found a similar problem, but I could cure it by lowering the thread
stack size with "pthread_attr_setstacksize"; this was not documented on the
version of linux I was using (RedHat/Fedora).  The default stack size is 1M, I
think.

By the way, I also changed VG_NTHREAD_KEYS, but I never understood what that
was really doing.  Is that not necessary?  Or, could it be harmful (other than
performance)?




               
__________________________________
Discover Yahoo!
Stay in touch with email, IM, photo sharing and more. Check it out!
http://discover.yahoo.com/stayintouch.html


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|

Re: Re: Increasing the max pthreads supported

njn (Bugzilla)-2
On Fri, 10 Jun 2005, Beorn Johnson wrote:

> By the way, I also changed VG_NTHREAD_KEYS, but I never understood what that
> was really doing.  Is that not necessary?  Or, could it be harmful (other than
> performance)?

As of 2.4.0 it's no longer used.  (In the 3.0 repository it's been
removed.)

N


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users