All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Stephan Zimmermann <s.zimmermann@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Using Xenomai in C++ App.
Date: Wed, 11 Jan 2006 15:00:40 +0100	[thread overview]
Message-ID: <43C50F88.1040501@domain.hid> (raw)
In-Reply-To: <200601111409.41282.s.zimmermann@domain.hid>

Stephan Zimmermann wrote:
> Hello List, 
> actually I am playing around with Xenomai 2.0.1 functions in a C++ 
> Application. I Wrote some simple wrapper-classes to use mutexes, semaphores 
> and tasks. Now, after thinking a while about message queues, I am confused 
> somehow. Is it possible to use the standard 'new' Operator in a mutithreaded 
> realtime application,

It's possible but could make some of your application threads migrate to secondary 
(i.e. relaxed execution) mode while running, due to the presence of Linux syscalls 
in the malloc code that underlies the standard C++ allocator, unless you did 
overload the new & delete operators appropriately. IOW, you would lose determinism 
wrt execution latency. Typical issues would concern brk() for extending the data 
segment of the current process to get more core, or controlled access to a 
contended critical section by means of glibc mutexes, that malloc() may start 
behind your back.

  or do I need to allocate memory inside a Xenomai heap
> (and overload operator new to do so)?

That would be a correct solution for keeping the allocation/deallocation ops 
within the bounds of very strict timing constraints, I think.

Hint: check out the T_WARNSW of rt_task_set_mode() for debugging unexpected 
transitions to secondary mode.

> 
> I would be thankful for some hints,
> Greetings, Stephan
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
> 


-- 

Philippe.


  reply	other threads:[~2006-01-11 14:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-02  9:06 [Xenomai-core] Xenomai v2.1-rc1 Philippe Gerum
2006-01-11 13:09 ` [Xenomai-help] Using Xenomai in C++ App Stephan Zimmermann
2006-01-11 14:00   ` Philippe Gerum [this message]
2006-01-11 15:48   ` 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=43C50F88.1040501@domain.hid \
    --to=rpm@xenomai.org \
    --cc=s.zimmermann@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.