From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Andrey Nechypurenko <andreynech@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Communication between RT and non-RT thread
Date: Wed, 06 Jul 2011 13:22:57 +0200 [thread overview]
Message-ID: <4E144591.6010906@domain.hid> (raw)
In-Reply-To: <CAOiXNkDLimRNcf1xwnJoMCx=Q3a87Pp9=_bsuN5DizKoGs7Xzg@domain.hid>
On 07/06/2011 11:25 AM, Andrey Nechypurenko wrote:
> Hi Folks,
>
> In my application I have Xenomai thread which collects and process
> sensor data. In addition, I have non-RT thread which sends sensor data
> over the network for visualization (with much lower time resolution,
> picking let's say every 100th sample). Xenomai thread is the only one
> which access sensors so there is a need to pass some samples to the
> non-RT communication thread. Basically, It is a typical
> producer/consumer situation which could be solved with thread-safe
> queue. Obviously, introducing such queue with standard synchronization
> mechanisms such as mutexes, etc. is not an option since it will
> influence the RT thread which will be forced to wait for non-RT
> thread.
You can use mutexes with priority inheritance to avoid this issue. But
Xenomai has ready made queues for rt/non-rt communication, the rtipcs:
http://www.xenomai.org/documentation/xenomai-head/html/api/group__rtipc.html
> While searching for the solution, I came to conclusion that lock-free
> [1] queue implementation is the way to go. Searching for such
> implementation which is also mature enough for real-life applications
> and works on ARM, the only one I found was boost_lockfree [2] . It is
> a great library, but it depends on boost, which in turns by default
> pulls Python and a lot of other things which are not necessary
> required on the embedded system (I am using BeagleBoard with Anstrom
> Linux distribution).
>
> I think, the situation I have (RT supplier/non-RT consumer) is quite
> typical and I hope there should be a typical good solution for it.
A lockless solution for this (one consumer, one producer) is the good
old fifo.
--
Gilles.
next prev parent reply other threads:[~2011-07-06 11:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-06 9:25 [Xenomai-help] Communication between RT and non-RT thread Andrey Nechypurenko
2011-07-06 11:22 ` Gilles Chanteperdrix [this message]
2011-07-06 11:42 ` Andrey Nechypurenko
2011-07-06 12:19 ` Gilles Chanteperdrix
2011-07-07 7:31 ` Richard Cochran
2011-07-07 7:57 ` Anders Blomdell
2011-07-07 8:44 ` Andrey Nechypurenko
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=4E144591.6010906@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=andreynech@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.