Re: pthread creates one extra thread

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

 



>     The linux kernel does not support the concept of threads (there are 
> no thread system calls). the only system calls for achieving this 
> somultaneous mechanism would be fork() and exec(). The pthreads library 
> used these system calls.

you are mistaken.
threads (roughly speaking) are two active entities, running in the same 
address space, so using exec or fork can not (EVER) achieve such 
behavior. 
pthread uses the clone system call, which does implements 
threads (of some kind, anyway). 

(actually, pthread uses clone with the following flags:
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND. look at man 2 clone 
for explanations.)


-- 
========================================================================
nir.

--
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