pthreads and number of processes in uClinux

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View

I noticed that when I had a simple non-threaded app, I would see a
single process in the $ps listing whenever it ran. Now that I have an
app that creates a single helper pthread, $ps shows three processes
during runtime. Why is that?
I am using mutexes. Does the third process represent these?

If I kill the first or last process by pid, they all get killed too, but
if I kill the 2nd by pid, nothing happens.

Re: pthreads and number of processes in uClinux
Quoted text here. Click to load it

Its the behavior of GNU libc's old linux-thread implementation. It uses
always one additional management thread if the process contain more than
one thread. So you see one thread or at least three threads per process.
If you kill your main thread or the management thread you kill the whole
process.
In the current nptl implementation this additional thread is gone. Sorry,
but I don't know how relevant this is for uClinux.

JB

Re: pthreads and number of processes in uClinux
Quoted text here. Click to load it

Does the posix pthread library just use glibc / uclibc ?

Quoted text here. Click to load it

There is a 14 page paper in the net on uclibc and NPTL. I d/l'ed it this
morning, but I did not yet read it. I heard it does not handle non
MMU-CPUs, which might or might not need special considerations due to
fork/vfork issues.

-Michael

Site Timeline