All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Daniele Nicolodi <daniele@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Which process synchronization primitive?
Date: Tue, 02 Mar 2010 14:21:09 +0100	[thread overview]
Message-ID: <4B8D10C5.9050108@domain.hid> (raw)
In-Reply-To: <4B8D0EEA.3090409@domain.hid>

Daniele Nicolodi wrote:
> Hello. I'm writing a data acquisition system (the code will be released
> open source soon) and i chose to use Xenomai to obtain real time
> performances.
> 
> The design of the system is inspired from JACK http://jackaudio.org/.
> Different functionalities are implemented in separate processes that
> communicate via a shared memory segment. However I need a processes
> synchronization primitive. In the first toy implementation of the system
> I have been using simple pipes and blocking reads (as is done in jack)
> and it work quite well. However I learned this mechanism is not suitable
> for real time.
> 
> Given that I would like to use the Xenomai Posix skin, so that my
> applications will build also without Xenomai support, which process
> synchronization primitive you suggest? Which is the overhead of
> different solutions?
> 
> I think message queues can work well but I'm not sure they are the best
> choice when I do not have to communicate any message. Would be
> semaphores best suited to my needs?

You can use process-shared mutexes or semaphores. But there is something
which must be said clearly: compiling or not with Xenomai support is all
or nothing. Either you build all the applications with Xenomai posix
support or none of them. There is no way you can synchronize a real-time
thread with a non real-time thread without loosing determinism. And
beware of the kind of priority inversions which would result from
calling a Linux system call while holding a mutex shared with real-time
processes, as explained here:

http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai#Chasing_the_unwanted_mode_switches.

-- 
					    Gilles.


  reply	other threads:[~2010-03-02 13:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02 13:13 [Xenomai-help] Which process synchronization primitive? Daniele Nicolodi
2010-03-02 13:21 ` Gilles Chanteperdrix [this message]
2010-03-02 13:41   ` Daniele Nicolodi
2010-03-02 18:05     ` Gilles Chanteperdrix
     [not found]       ` <4B8E9649.1060902@domain.hid>
2010-03-03 17:10         ` 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=4B8D10C5.9050108@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=daniele@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.