From: Anders Blomdell <anders.blomdell@domain.hid>
To: Richard Cochran <richardcochran@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Communication between RT and non-RT thread
Date: Thu, 07 Jul 2011 09:57:04 +0200 [thread overview]
Message-ID: <4E1566D0.3030203@domain.hid> (raw)
In-Reply-To: <20110707073124.GC3467@domain.hid>
On 07/07/2011 09:31 AM, Richard Cochran wrote:
> On Wed, Jul 06, 2011 at 02:19:47PM +0200, Gilles Chanteperdrix wrote:
>> On 07/06/2011 01:42 PM, Andrey Nechypurenko wrote:
>>>
>>> What makes me worry here is the IPC abbreviation - I have just one
>>> process with multiple threads. So would not real IPC mechanism be the
>>> overkill in this scenario? Or am I just misinterpret what IPC means
>>> here?
>
> ...
>
>>
>> I am talking about the ring buffer thing with head and tail pointers
>> where each thread (consumer, producer), moves only one pointer. I would
>> call this a "lockless fifo", though I do not know what the official name
>> is, but you get the idea. Again, you can send pointers through an IPC
>> instead of sending the data themselves, and you will benefit from the
>> fact that the two threads are running in the same memory space.
>
> In Andrey's case, I would simply use a ring buffer (fifo) shared
> between one RT and one non-RT thread. No locking is needed, and it is
> easy to implement. You don't need a library for that.
If you want to do lockless passing of data, make sure that you have read
and understood linux/Documentation/memory-barriers.txt
/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:[~2011-07-07 7:57 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
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 [this message]
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=4E1566D0.3030203@domain.hid \
--to=anders.blomdell@domain.hid \
--cc=richardcochran@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.