All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: tom@kavaga.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Possible 2.6.24-rc7 issue w/respect to pthreads
Date: Wed, 09 Jan 2008 11:51:55 +0100	[thread overview]
Message-ID: <4784A74B.3040807@pengutronix.de> (raw)
In-Reply-To: <39848.76.189.45.79.1199874932.squirrel@webmail.kavaga.com>

[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]

tom@kavaga.com wrote:
> To Whom It May Concern,
> 
> After I patched my 2.6.23 kernel to 2.6.24-rc7 this morning, I noticed
> some odd behavior with respect to POSIX threads in a test program I had
> written (originally to test epoll.)
> 
> The behavior is as follows:
> 
> 1.  main() creates a new thread of execution with pthread_create
> 2.  thread_func() immediately calls pthread_detach(), which is supposed to
> ensure that thread resources are cleaned up when the thread terminates.
> 3.  The spawned thread sleeps and then prints a message "got here"
> 4.  The main thread calls pthread_join().  According to the POSIX
> documentation, this should suspend execution until the spawned thread has
> terminated.

Quoting the man page of pthread_detach():

After pthread_detach completes, subsequent attempts to perform
pthread_join on th will fail.

regard - Marc
-- 
 Marc Kleine-Budde              Phone: +49-231-2826-924
 Pengutronix - Linux Solutions for Science and Industry
 Vertretung West/Dortmund     http://www.pengutronix.de


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2008-01-09 10:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-09 10:35 Possible 2.6.24-rc7 issue w/respect to pthreads tom
2008-01-09 10:51 ` Marc Kleine-Budde [this message]
2008-01-09 10:53 ` Jakub Jelinek
2008-01-09 11:07 ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4784A74B.3040807@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tom@kavaga.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.