[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



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.

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.

> 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.

Regards,
-- gotom



Reply to: