From: Jan Kiszka <kiszka@domain.hid>
To: Vincent Levesque <vleves@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] How to implement a GUI for RT apps?
Date: Tue, 25 Oct 2005 11:00:19 +0200 [thread overview]
Message-ID: <435DF423.5000800@domain.hid> (raw)
In-Reply-To: <435D7D8C.1010004@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2263 bytes --]
Vincent Levesque wrote:
> Hello,
>
> I'd like to have your opinion on the best way to implement a GUI for a
> RT application. The standard approach seems to be to split of the
> application in two processes that communicate using shared memory or
> queues. I've been using a different approach that's closer to what's
> done in many non-realtime apps. I tried to put both the GUI and RT code
> in a single process using threads, shared objects and mutexes. It seemed
> to work fairly well for a while but it stopped working after switching
> to GCC 4.0 (while upgrading Ubuntu Linux). After spending a few days
> debugging this problem, I get the feeling that I'm doing something
> "illegal" with RTAI/fusion that worked by accident until the upgrade.
>
> Here's what I've been doing... I create some objects, each with its own
> RT_MUTEX. I then create two RT tasks: one for the GUI and one for my
> hardware. Both taks have pointers to the shared objects. They call the
> objects' methods directly. The object locks or tries to lock its mutex
> in its methods, as appropriate. Both tasks are thus using the same
> RT_MUTEX structure. I've been careful to lock the mutexes only for short
> amounts of time and to only try to lock it in critical code.
...and hopefully do not call any non-rt functions while holding the
lock. Note that you can install a SIGXCPU handler to catch such
potential accidental violations. Likely not needed if you only copy some
data between the shared objects and your local buffers (all locked into
memory - mlockall?).
>
> To summarize,
>
> 1. What's the best way to implement a GUI for a RT app?
Depends too much on your requirements, GUI toolkit, etc. to give a
general statement here.
> 2. Is my approach "legal" in fusion/xenomai?
Sounds sane to me. Which fusion version are you using? Already tried to
update some component (kernel, patch, fusion/xenomai) and watch
potential changes?
> 3. I remember reading that RTAI and X don't play well together. Is that
> the case with Xenomai? Will things be better if I use the two-processes
> approach?
Not a general problem, but a specific one related to certain graphic
cards and drivers (don't ask me which, we are only using head-less or
console-based boxes here).
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
next prev parent reply other threads:[~2005-10-25 9:00 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 [this message]
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
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=435DF423.5000800@domain.hid \
--to=kiszka@domain.hid \
--cc=vleves@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.