ARM pthread create an addictional process. why?

I've noticed a strange behavior in pthread_create call... I've a deamon PID[60] PPID[1], I call pthread_create and I'll have: my deamon PID[60] PPID[1], a strange process PID[62] PPID[60] my thread PID[81] PPID[62]

look like that my arm kernel needs an intermediate process PID[62] to create my threads.

If I exit my thread and create another thread I'll have: my new thread PID[102] PPID[62]

Probably is the correct behavior...

Could you clarify me?

unamed: Linux arm9 2.4.26-vrs1-mx1ads_0406251307

Thanks

Reply to
Franco
Loading thread data ...

linux-2.4 didn't have threads; libraries for theading forked processes to do the trick.

Reply to
AZ Nomad

Thank you very much, I suspected something like this.

Reply to
Franco

This is a very misleading response. The library uses the clone() system call which is markedly different from fork().

The Linux 2.6 implementation also uses clone(), but there is extra support in the kernel which improves efficiency and POSIX compliance.

Reply to
Geronimo W. Christ Esq

The threading implementation in Linux 2.4 uses LinuxThreads. This creates a management thread when it is in use. This is not specific to ARM, it happens with all architectures, though I'm not sure if the new NPTL implementation does it.

So, if you call pthread_create once, there will be a total of three PIDs

- the original process; the management thread; and the new thread you created. I believe that the management thread goes away when the last thread exits.

Reply to
Geronimo W. Christ Esq

"Geronimo W. Christ Esq" ha scritto nel messaggio news: snipped-for-privacy@proxy00.news.clara.net...

Thank you very much.

Reply to
Franco

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.