All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "Soboljew, Patrick" <Patrick.Soboljew@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Problem with pthread_cond_wait
Date: Thu, 03 Dec 2009 14:15:37 +0100	[thread overview]
Message-ID: <4B17B9F9.7070409@domain.hid> (raw)
In-Reply-To: <EA8B423DB69FD24FA233008019A052AE015C06A9@domain.hid>

Soboljew, Patrick wrote:
> Hello all,
> 
> I have a strange problem concerning the posix skin of xenomai (Ver.
> 2.4.9.1). Whenever two or more threads call 'pthread_cond_wait' and I
> want to interrupt the program with SIGINT (CTRL-c) only the main thread
> and the first thread that called 'pthread_cond_wait' get the signal. The
> remaining threads are not interrupted so I have created some zombies
> here. I discovered this problem when I tried to debug some code with the
> ACE/TAO Framework which calls these functions in a similar way. The
> debugger also has problems to interrupt these threads.
> 
> The small code example illustrates what I did.
> 
> Has anyone an idea what exactly causes this problem?

I believe the problem is that the other threads are blocked on the mutex
relocking by pthread_cond_wait. I believe this issue has just been
solved in 2.5 by the rework of pthread_cond_wait. I need to check with
your test program.

Getting the current situation to work implies handling the SIGINT (or
SIGTERM) by cancelling all threads. Then in each thread doing a
pthread_cond_wait registers a cleanup handler (pthread_cleanup_push)
that releases the mutex.

If I am right, I will check if it is possible to backport the
pthread_cond_wait rework without breaking the ABI.

-- 
                                          Gilles



  reply	other threads:[~2009-12-03 13:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-03 12:07 [Xenomai-help] Problem with pthread_cond_wait Soboljew, Patrick
2009-12-03 13:15 ` Gilles Chanteperdrix [this message]
2009-12-03 23:58 ` Gilles Chanteperdrix
2009-12-04  9:46   ` Soboljew, Patrick
2009-12-04  9:59   ` Philippe Gerum
2009-12-04 10:09     ` Gilles Chanteperdrix
2009-12-04 10:26       ` Gilles Chanteperdrix
2009-12-06 17:22       ` Philippe Gerum

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=4B17B9F9.7070409@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=Patrick.Soboljew@domain.hid \
    --cc=xenomai@xenomai.org \
    /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.