From: Anders Blomdell <anders.blomdell@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] What have I misunderstood about condition variables
Date: Wed, 12 Mar 2008 13:00:57 +0100 [thread overview]
Message-ID: <47D7C5F9.4030203@domain.hid> (raw)
In-Reply-To: <18391.3867.521099.955604@domain.hid>
Gilles Chanteperdrix wrote:
> Anders Blomdell wrote:
> > Gilles Chanteperdrix wrote:
> > > On Tue, Mar 11, 2008 at 7:19 PM, Anders Blomdell
> > >> To me the symptoms indicate that the high priority producer gets the mutex and
> > >> signals it before the consumer has properly started to wait on the condition.
> > >
> > > I have not read your program in detail, but what may be your problem
> > > is that condition variables are not semaphores: if you signal a
> > > condition variable when nobody is waiting the signal is lost.
> > I know this, but the problem is that the program loses signals when it is
> > waiting. In the consumer:
>
> Sorry for the noise (and thanks for the patch).
You are welcome.
Small afterthought/question. In the following code:
xnlock_get_irqsave(&nklock, s);
...
mutex->lockcnt = 0;
if (xnsynch_wakeup_one_sleeper(&mutex->synch_base)) {
mutex->lockcnt = 1;
/* Scheduling deferred */
}
thread = xnpod_current_thread();
xnsynch_sleep_on(&cond->synch_base, timeout, XN_RELATIVE);
Am I correct in assuming that no other task (even on a multiprocessor) can claim
the mutex until xnsynch_sleep_on has done its rescheduling?
/Anders
--
Anders Blomdell Email: anders.blomdell@domain.hid
Department of Automatic Control
Lund University Phone: +46 46 222 4625
P.O. Box 118 Fax: +46 46 138118
SE-221 00 Lund, Sweden
next prev parent reply other threads:[~2008-03-12 12:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-11 18:19 [Xenomai-help] What have I misunderstood about condition variables Anders Blomdell
2008-03-11 18:27 ` Gilles Chanteperdrix
2008-03-11 19:27 ` Anders Blomdell
2008-03-11 20:13 ` [Xenomai-core] " Anders Blomdell
2008-03-12 14:14 ` Philippe Gerum
2008-03-11 23:00 ` Gilles Chanteperdrix
2008-03-12 12:00 ` Anders Blomdell [this message]
2008-03-12 13:11 ` Gilles Chanteperdrix
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=47D7C5F9.4030203@domain.hid \
--to=anders.blomdell@domain.hid \
--cc=gilles.chanteperdrix@xenomai.org \
--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.