All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <kiszka@domain.hid>
To: "Ignacio García Pérez" <iggarpe@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] How to implement a GUI for RT apps?
Date: Tue, 25 Oct 2005 17:59:03 +0200	[thread overview]
Message-ID: <435E5647.70406@domain.hid> (raw)
In-Reply-To: <435E5044.8090600@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 2211 bytes --]

Ignacio García Pérez wrote:
> Jan Kiszka wrote:
> 
> 
>>Ignacio García Pérez wrote:
>> 
>>
>>
>>>>1. What's the best way to implement a GUI for a RT app?
>>>>     
>>>>
>>>
>>>Make it non-RT. The "U" in "GUI" is user. Users are not real time.
>>>
>>>   
>>>
>>
>>Not true. That thread must be mapped to Xenomai in order to use
>>rt-mutexes. Otherwise, one has to use rt-pipes.
>>
>>Jan
>>
>> 
>>
> 
> I was talking design. Anything that requires user interaction is by
> definition non-realtime, so,  if you have the choice to leave it out of

Do you happen to design ATMs as well? They interact with me, a user, but
also not in real-time. I typically have to type my PIN at least two
times to get all digits recognised. ;)

> the RT domain, do it. You'll save a lot of headaches.
> 
> Of course, if your GUI is so tightly coupled to your RT processing that
> you cannot do without rt_mutexes and/or other sync primitives, then you
> must map it to Xenomai.

Basically, we are discussing here where to put the "bridge" between RT
and non-RT. Some instance in your system has to be a bridge which
switches between both worlds in order to get data in and out of the RT
domain. Such bridge can be a rt-pipe (and related variants) or an
explicitly coded version at application layer. I don't see why it should
be bad design or cause troubles to create Xenomai RT threads like this:

while (!finished) {
    do_a_lot_of_non-rt_stuff;

    rt_mutex_lock();
    copy_data_between_rt_and_local_buffers;
    rt_mutex_unlock();

    do_more_non_rt_stuff;
}

Only when the code between rt_mutex_lock and unlock gets too complicated
and intransparent, your design needs a revision.

Ok, an option that does not require context migrations is lock-less
synchronisation. For example, one may maintain revision counters of data
structures which get updated on changes by the RT part. The non-RT part
can then spin on reading a consistent version until the revision on
entry equals the one on exit. And double-buffering can be used to write
data structures into the RT domain. But this can be more complex and is
not feasible in each and every scenario.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

  reply	other threads:[~2005-10-25 15:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-25  0:34 [Xenomai-help] How to implement a GUI for RT apps? Vincent Levesque
2005-10-25  9:00 ` Jan Kiszka
2005-10-25 22:22   ` Vincent Levesque
2005-10-25 20:51     ` Jan Kiszka
2005-10-25 10:23 ` Ignacio García Pérez
2005-10-25 10:29   ` Jan Kiszka
2005-10-25 15:33     ` Ignacio García Pérez
2005-10-25 15:59       ` Jan Kiszka [this message]
2005-10-26  0:06         ` Vincent Levesque
2005-10-25 21:33           ` Jan Kiszka
2005-10-25 22:07             ` Hannes Mayer

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=435E5647.70406@domain.hid \
    --to=kiszka@domain.hid \
    --cc=iggarpe@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.