overhead of process/task_struct in POSIX threads- why?

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

 



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/


[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