From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Bob Feretich <bob.feretich@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Shared memory between a Xenomai user task and a standard Linux process?
Date: Mon, 02 Aug 2010 23:52:47 +0200 [thread overview]
Message-ID: <4C573E2F.2060304@domain.hid> (raw)
In-Reply-To: <4C572FF7.5090200@domain.hid>
Bob Feretich wrote:
> Thank you for the solution. Using Linux shm shared memory should have
> been obvious. :-[
>
> I was still thinking of Xenomai user tasks as running in a walled of
> environment. I've got to remember that when a rt user task is in
> secondary mode it has full access to Linux facilities.
>
> When my rt user task starts and ends it is in secondary mode. It can
> easily shmat() and shmdt() during these start and end periods.
Yes, and a process running Xenomai threads may also run non-Xenomai
threads, they will share the same memory, without needing to resort to
shared memories.
As for the shared memory, you may also use the POSIX interface:
shm_open/ftruncate/mmap/shm_close/shm_unlink
You may find it more convenient.
>
> As Philippe states, I just need to be careful about the synchronization
> method I use. The Linux process must never be able to block the rt task.
> (If the rt task wraps the buffer, we'll just throw away the history data
> until space becomes available and report a "data overrun" on the next
> block written.) As I said before, the buffer should be large enough so
> that never happens anyway.
You can use a FIFO, with a periodic non-rt thread polling one of the
FIFO's pointers. This would look a lot like what rt_printf does (file
src/rtdk/rt_print.c in Xenomai sources).
--
Gilles.
prev parent reply other threads:[~2010-08-02 21:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-02 2:06 [Xenomai-help] Shared memory between a Xenomai user task and a standard Linux process? Bob Feretich
2010-08-02 5:42 ` Philippe Gerum
2010-08-02 6:01 ` Gilles Chanteperdrix
2010-08-02 17:38 ` Philippe Gerum
2010-08-02 17:56 ` Gilles Chanteperdrix
2010-08-02 20:52 ` Bob Feretich
2010-08-02 21:52 ` Gilles Chanteperdrix [this message]
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=4C573E2F.2060304@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=bob.feretich@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.