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 23:33:16 +0200 [thread overview]
Message-ID: <435EA49C.3090402@domain.hid> (raw)
In-Reply-To: <435EC897.3020601@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2198 bytes --]
Vincent Levesque wrote:
> Hi Jan and Ignacio,
>
>>>> Not true. That thread must be mapped to Xenomai in order to use
>>>> rt-mutexes. Otherwise, one has to use rt-pipes.
>>>>
>
> That's the impression I had. Is there anything I should do in the GUI
> task to make it closer to a non-RT thread? Is there any way, for
> example, to make it remain in secondary mode? I already set the task to
> a low priority.
You can explicitly switch the mode (rt_task_set_mode), but this is
generally not needed.
>> 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.
>>
>>
> That's very interesting. I'm not 100% clear on what you mean though. If
> I understand correctly, I could have a single RT task and a normal
> thread (or the main thread) for the GUI. I could then use the fact that
> the RT task cannot be interupted by the GUI thread (?) to make sure data
> structures do not get corrupted. Do I get this right?
Partially. On a single-CPU system, you can make use of the fact that
RT-tasks can always complete their modifications before a non-RT-task
gets the CPU again. But this is a fragile approach if you think of
upcoming dual-core systems.
For common systems it is safer to track modifications based on some
revision counter the changing instance increments when it touches data.
The interrupted reader can than check if things changed by 1. saving the
counter, 2. reading the data, 3. comparing the counter against the
original value. If both value are the same, the read data is consistent.
Otherwise the reader has to retry. Note that this approach implies that
the read data is never in a state which can break the reader
(inconsistent pointers e.g.).
But I must confess we also once made use of the UP characteristic for
some real-time application...
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
next prev parent reply other threads:[~2005-10-25 21:33 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
2005-10-26 0:06 ` Vincent Levesque
2005-10-25 21:33 ` Jan Kiszka [this message]
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=435EA49C.3090402@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.