Re: pthread creates one extra thread

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

 



On Mon, 2004-01-05 at 19:45, Jan Krause wrote:

> 1. Whats the difference between original and master thread?
> 
> 2. I only see 2 threads started, namely the main thread ( void main () ) and the
> one created with pthread_create... but if this thread immediately exits
> as you said, there should only be 1 left: the main () thread, but thats not the case.
> 
> Where is my fault?

You need to call pthread_join(3) from the parent on the child thread or
create the thread with PTHREAD_CREATE_DETACHED or call pthread_detach(3)
from the child thread.

This is basic POSIX thread behavior and not a kernel issue.

	Rob Love



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