From: Jan Kiszka <jan.kiszka@domain.hid>
To: MEYLAN Jean-philippe <Jean-philippe.Meylan@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] task rate control with alarm and semaphore
Date: Thu, 01 Nov 2007 11:56:56 +0100 [thread overview]
Message-ID: <4729B0F8.5020704@domain.hid> (raw)
In-Reply-To: <44D6D942646F9E43B7CFFFD3F250EDCD08E9C3@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 825 bytes --]
MEYLAN Jean-philippe wrote:
> Hello,
>
> I'm working on the creation of a Xenomai target for Mathwork's
> Real Time Workshop. In order to achieve this, I would like to
> control the execution rate of a task with a semaphore periodically
> released by an alarm handler. The tasks does nothing else but waiting
> (in a loop) on the semaphore. If the task can immediately take
> the sempahore, it means that the rate is too fast for it because
> the semaphore has been released before the end of its current iteration.
Some more efficient way is to let the thread monitor its execution time
and derive the next wakeup date from it. Think of:
next_wakeup = now();
do_forever
next_wakeup += period;
do_some_rt_job();
if next_wakeup >= now() then
handle_overload()
sleep_until(next_wakeup)
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
prev parent reply other threads:[~2007-11-01 10:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 10:45 [Xenomai-help] task rate control with alarm and semaphore MEYLAN Jean-philippe
2007-10-31 17:45 ` ROSSIER Daniel
2007-10-31 19:21 ` Gilles Chanteperdrix
2007-11-01 8:25 ` ROSSIER Daniel
2007-11-01 15:21 ` Philippe Gerum
2007-11-01 10:56 ` Jan Kiszka [this message]
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=4729B0F8.5020704@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=Jean-philippe.Meylan@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.