[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: NPTL when dynamically linked linuxthread when statically => How to have NPTL with -static ld flags



GOTO Masanori wrote:
At Mon, 11 Oct 2004 15:17:33 +0200,
Eric Valette wrote:

I'm trying to port a soft RT Posix Application from LynxOS to Linux 2.6. Application works great but due to dynamic libraries inefficencies when mlockall is used, I need to link statically (For those interested reported status VmSize goes from 90 Mb to 35Mb...).


We ship linuxthreads' libpthread.a, but we don't ship nptl's
libpthread.a.  So, when you link statically with -lpthread,
linuxthreads' libpthread.a is linked.

That is really a problem as :
- The level of POSIX compliance of linuxthread is far less than the NPTL thread,
	- The performance are also a concern,
- Nothing prevent for having a static version of NPTL like mandrake, red hat do,

We can export both nptl and linuxthreads libpthread.a like
libpthread_nptl.a and libpthread_linuxthreads.a.  But I think it's
just debian's local hack - it may be ugly way.

The other distro do /usr/lib/nptl/*.a (including libc)

But I noticed when doing ps ax that in the dynamic case I have a single process with 9 threads and in the other case 9 process as if I was using linuxthread.

Is there anything special to do? Should I open a bug to libc6-dev


Threads of linuxthread are appeared as multiple processes.  nptl is
the newer version than linuxthreads.  nptl kernel hides such multiple
threads, and threads are appeared as a single process when you execute
ps command.  However, note that kernel scheduler handles them as
multiple processes like linuxthreads.  It's appearance issue, and it's
normal behavior.

I already know all this but definitively want to have static application behaves as dynapic one which is not the case actually : linuxthreads version behaves incorrectly ...

So I think this is a serious bug and will fill a bug report. How can I do this myself in the mean time?

Thanks for responding,

Whish you a nice day,

-- eric



Reply to: