All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Lionel Perrin <perrin@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] shm_open, ftruncate
Date: Fri, 9 Jun 2006 13:46:42 +0200	[thread overview]
Message-ID: <17545.24482.769468.81330@domain.hid> (raw)
In-Reply-To: <448937A5.7080701@domain.hid>

Lionel Perrin wrote:
 >  
 > >  > > I can confirm that a few fixes in v2.1 were missing, so trunk works
 > >  > > correctly, didn't you forget to rebuild the kernel when building trunk ?
 > >  > > Attached is a patch to v2.1 that contain the fixes backported from
 > >  > > trunk. Please try this patch and tell me if this works for you.
 > >  > >   
 > >  > In fact, I've downloaded the last version of trunk before your mail and 
 > >  > the patch. You're right that works pretty good with this version... :)
 > >  > 
 > >  > Unfortunately, it seem's that we can't share between a real time process 
 > >  > and a non real one ?
 > >
 > > Sharing memory should work, could you explain what happens ? Note that
 > > you may use Linux regular shared memory services in the real-time
 > > process by calling __real_shm_open instead of shm_open.
 > >   
 > Ok,
 > But I'd like a real time behaviour of shared memory for my real time 
 > task... so I can't use __real_shm_open, etc...
 > 
 > Here is the little code I've developped to access shared memory. May be 
 > there some mistakes...
 > I compile it with or without xeno-config --posix-cflags, xeno-config 
 > --posix-ldflags to get two executables.
 > I launch these two executables and the shared_memory seem's to be 
 > different in these two cases.
 > All Xenomai processes are accessing the same shared_memory while all 
 > non-xenomai processes are accessing another one shared memory.

That is the expected behaviour: xenomai posix skin shared memory is
different from Linux regular shared memory. In the same vein, xenomai
posix skin semaphores are different from Linux regular semaphores.

But there is no problem using Linux regular shared memory in a real-time
thread, providing that you call mlockall. Using a Linux regular
semaphore in a real-time thread is also possible by using
__real_sem_post or __real_sem_wait, but the real-time
thread will migrate to secondary mode.

The alternative is to compile the two processes with the flags given by
xeno-config, and to create non real-time threads in one process using
__real_pthread_create.

-- 


					    Gilles Chanteperdrix.


  reply	other threads:[~2006-06-09 11:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-02 15:29 [Xenomai-help] shm_open, ftruncate Lionel Perrin
2006-06-02 16:29 ` Gilles Chanteperdrix
2006-06-02 17:17 ` Gilles Chanteperdrix
2006-06-05 13:49   ` Lionel Perrin
2006-06-05 15:55     ` Gilles Chanteperdrix
2006-06-06 11:53       ` Lionel Perrin
2006-06-06 12:21         ` Gilles Chanteperdrix
     [not found]           ` <44859C28.3090600@domain.hid>
     [not found]             ` <17541.49945.431732.834139@domain.hid>
2006-06-07 12:55               ` Lionel Perrin
2006-06-07 14:52                 ` Gilles Chanteperdrix
2006-06-09  8:56                   ` Lionel Perrin
2006-06-09 11:46                     ` Gilles Chanteperdrix [this message]
2006-06-09 12:28                     ` Gilles Chanteperdrix
2006-06-09 13:18                       ` Lionel Perrin
2006-06-06 18:08         ` 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=17545.24482.769468.81330@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=perrin@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.