[KLUG Programming] Pthreads problem

Adam Williams programming@kalamazoolinux.org
Wed, 31 Dec 2003 13:56:41 -0500


> >>I'm having some shared memory/size (??) problems using threads. Is
> >>POSIX threads under Linux stable?
> >What version of Linux? As I recall, Red Hat 9.0 backported the new
> >Native POSIX Thread Library (NPTL) to 2.4. That might have bugs.
> I'm running RedHat 7.3 (Valhalla) 2.4.18-10smp #1 SMP on a dual CPU 
> system w/ 500 MBytes
> of main memory

I run a massively threaded application with ~700Mb of shared memory on a
machine with a much older kernel/glibc that this.  Rock solid.

Currently there are 91 working threads (just looked).  Uptime 173 days. 
Application starts when the machine boots.



> >What is listed in '/proc/sys/kernel/shmmax'? On my 2.6 kernel, it is
> >33554432 (32 MB). 
> Mine has the same! 

It is the default.  Linux is tuned for use as a workstation on a
mid-range Best Buy kinda box.  Other applications require tweakage.

> Is this what Threads uses for shared memory limits?
> What does it do if you exceed these limits? I didn't see an warnings or
> error msgs. Is this just some default constant that I can change? Does 
> it have any impact elsewhere? Are there any real limits for this other than main 
> memory size?

ftp://ftp.kalamazoolinux.org/pub/pdf/PerfTune2001.pdf

You at least want to look at slide 77.

Hopefully once 2.6.x is in full swing either myself or Mr. Buxton
(current 2.6.x guru) will update the above document.