Re: overhead of process/task_struct in POSIX threads- why?

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

 



I actually don't manually configure my glibc. I use gentoo and I use the nptl "use flags" for the same. However, it seems (from a glance at the gentoo glibc compilation scripts) that you can enable nptl support (and remove linuxthread support) while ./configuring your glibc. You might like to look at the relevant glibc configure/install documentation and build one yourself.

Ritesh

On 7/20/06, Parav Pandit <paravpandit@xxxxxxxxx> wrote:
Hi Ritesh,

Can you tell me how can I enable this support or how
can I use the NPTL library in my linux kernel 2.6.10?
Any flags to put in Makefile or something else?

Parav


--- Ritesh Kumar < ritesh@xxxxxxxxxx> wrote:

> Can you post the output of the command
> /lib/libc-2.x.x.so?
> Look out for the kind of thread implementation you
> are using. If its
> linuxthreads then you are using an old (and not very
> POSIX compliant)
> threading library on linux. On linux 2.6 you have
> the option of NPTL support
> in glibc which is a newer better threading library
> which shouldn't show you
> this weirdness.
>
> linuxthreads uses a separate "helper thread" for
> managing the other threads
> of a process. This explains your extra thread.
>
> Ritesh
>
>
> On 7/19/06, Parav Pandit <paravpandit@xxxxxxxxx>
> wrote:
> >
> > Hi,
> >
> > I have created 4 threads in my linux system using
> > pthread_create() API.
> > Each thread does nothing but just sleeps using
> > sleep().
> >
> > e.g.
> > int main()
> > {
> > pthread_create(thread1);
> > pthread_create(thread2);
> > pthread_create(thread3);
> > pthread_create(thread4);
> > while(1) {
> > };
> > return 0;
> > }
> >
> > Here are the results of "top".
> >
> > Before running above program,
> > total process = 35
> > sleeping process = 34,
> > running = 1.
> >
> > After running about program,
> > total process = 41
> > sleeping process = 39,
> > running = 2.
> >
> > Can somebody give me justification for this
> addition
> > of one more process for this?
> > We know that threads = processes = task_struct in
> > kernel when it comes to scheduling them.
> >
> > But why there is an overhead of one more
> > thread/process?
> >
> > Regards,
> > Parav Pandit
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> > --
> > Kernelnewbies: Help each other learn about the
> Linux kernel.
> > Archive:
> http://mail.nl.linux.org/kernelnewbies/
> > FAQ:           http://kernelnewbies.org/faq/
> >
> >
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux