Multiple PIDs for a multithreaded program

Andreas Wehrmann a.wehrmann at centersystems.com
Mon May 4 14:33:10 UTC 2009


Hey there,

in Linux a thread is a normal process with the specialty that it shares some
attributes with its creator (i.e. file descriptors, heap memory)...
That's why each thread gets its own PID.

Regards,

Andreas



Guillaume Dargaud wrote:
> Hello all,
> I'm not sure what mailing list this question belongs to.
>
> I just added some multithreading to a user app and I'm surprised to
> see it show with 4 different PIDs when I use ps or top. The program
> has 3 threads, including the main one.
> I thought that only forked programs created different PIDs, not threads.
>
> I'm on Buildroot+Busybox+uClibc, all about 6 months old.
>
> Anyone cares to explain, thanks (I breaks some control scripts).
> ------------------------------------------------------------------------
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox

-------------- next part --------------
A non-text attachment was scrubbed...
Name: a_wehrmann.vcf
Type: text/x-vcard
Size: 346 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090504/737a39b3/attachment.vcf>


More information about the busybox mailing list