[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pthread creates one extra thread
Hi,
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?
On Mon, 05 Jan 2004 19:02:14 -0500
Rob Love <rml@ximian.com> wrote:
> On Mon, 2004-01-05 at 18:28, Jan Krause wrote:
> > I found out that if you uncomment the while line in the my_func_1 function,
> > your code works as wished and creates 2 threads.
> >
> > Unfortunately I dont really know why the while loop is unnecessary. ;)
>
> If you get rid of the while loop, the thread exits immediately.
>
> And thus you will see a total of two threads (the original thread and
> the master thread).
>
> Rob Love
>
>
>
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive: http://mail.nl.linux.org/kernelnewbies/
> FAQ: http://kernelnewbies.org/faq/
>
>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/