All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Jan Kiszka <jan.kiszka@domain.hid>,
	"M. Koehrer" <mathias_koehrer@domain.hid>,
	xenomai@xenomai.org
Subject: Re: [Xenomai-help] posix functions for real time and non real time
Date: Tue, 08 Jan 2008 14:44:08 +0100	[thread overview]
Message-ID: <47837E28.5040406@domain.hid> (raw)
In-Reply-To: <2ff1a98a0801080518k8970391kc2f0a4166adfe393@domain.hid>

Gilles Chanteperdrix wrote:
> On Jan 8, 2008 1:47 PM, Jan Kiszka <jan.kiszka@domain.hid> wrote:
>> M. Koehrer wrote:
>>> Hi Gilles,
>>>
>>> thank you very much for the response.
>>> I tried this out and found one strange thing:
>>> When I run the following simple example (that uses the __real_pthread_ functions)
>>> the executable appears in the /proc/xenomai/stat list.
>>> As I am calling __real_pthread_create() I expected that my program does not appear
>>> in xenomai at all.
>>> Build is done using xeno-config --posix-cflags plus -O2 -Wall. For linking xeno-config --posix-ldflags
>>> is used.
>> POSIX-skin applications automatically map the main thread to a (prio-0)
>> Xenomai thread, therefore you see at least one thread in /proc/xenomai.
>> Technically, this happens in the init function of the pthread_rt lib you
>> link against, and it helps your main thread to interact with Xenomai
>> resources without explicit (non-standard) thread wrapping.
>>
>>> Another question:
>>> Is there a special header file available that has some defines to map the pthread_xxx
>>> function to __real_pthread_xxx.
>>> By including this header I do not have to modify the C code of that files that should
>>> use the non real-time functions.
>> You are tackling an important issue: How to build large-scale POSIX
>> applications over Xenomai when they have both RT and non-RT parts?
>> Possible strategies:
>>
>> [RT part dominates]
>>  - Wrap the non-RT calls with "__real_"-prefixes
>>
>> [Non-RT part dominates]
>>  - Invoke RT-services explicitly via "__wrap_"-prefixes
>>
>> [Both cases]
>>  - Separate RT- and non-RT-only components into separate program
>>    modules, link them in two steps: first RT with Xenomai args and
>>    non-RT as usual, then link both intermediate parts together
>>
>> For this wrapping, I think that renaming macros for pthread services
>> could indeed be useful (e.g. something that translates
>> rt_pthread_mutex_lock in the source code into __warp_pthread_mutex_lock
>> for the linker).
> 
> When you try to mix up real-time and non real-time threads, it all
> becomes very complicated. You do not need your complication: just make
> all your tasks real-time tasks (using priority 0 for low priority
> tasks) and forget about __real_* calls.

That can be inefficient in large applications: You don't need the
(average-case) overhead of Xenomai IPC for pure non-RT interaction. And
IPC object creation is precisely the critical point, because their type
cannot be told apart by the wrapping layer based on generic parameters.

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux


  parent reply	other threads:[~2008-01-08 13:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-08  7:17 [Xenomai-help] posix functions for real time and non real time threads M. Koehrer
2008-01-08 10:23 ` Gilles Chanteperdrix
2008-01-08 11:39   ` [Xenomai-help] posix functions for real time and non real time M. Koehrer
2008-01-08 12:47     ` Jan Kiszka
2008-01-08 13:18       ` Gilles Chanteperdrix
2008-01-08 13:28         ` Gilles Chanteperdrix
2008-01-08 13:44         ` Jan Kiszka [this message]
2008-01-08 13:46           ` Gilles Chanteperdrix
2008-01-08 13:58             ` Jan Kiszka
2008-01-08 14:41               ` Philippe Gerum
2008-01-08 15:09                 ` Jan Kiszka
2008-01-08 15:50                   ` Philippe Gerum
2008-01-08 16:11                     ` Gilles Chanteperdrix
2008-01-08 17:10                       ` Philippe Gerum
2008-01-08 17:41                         ` Gilles Chanteperdrix
2008-01-08 15:01     ` 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=47837E28.5040406@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.org \
    --cc=mathias_koehrer@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.