[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
-----BEGIN PGP SIGNED MESSAGE-----
This message is sort of a follow-up to Benny Prijono's mail (16th March)
concering soft RT capabilities in FBSD:
I have a simmilar question. Let me first briefly describe my problem:
I am working on sort of a heartbeat generation signal. This can be envisioned
as something like a pacemaker. However it would NOT control any valves :) It
will only send a "now" signal to some sound output program. The rate at which
the "now" signal is sent is controled by some mathematical curve (i.e. the
frequency of the "pacemaker" is time dependant).
And of course... this program wont harm anybody if it is slightly out of
If I used /dev/rtc I would have to re-program the clock after each read()
call to the new frequency. I was wondering if there is another approach apart
from reading /dev/rtc....
Would the following work? :
send "now" signal to sound output program;
calculate: "offset" := time effectively slept - time I wanted to usleep();
remember max "offset" value;
next time I usleep() , I would usleep() "offset" usecs less;
and spin lock / loop for the rest of the time.
I _would_ prefer using that way instead of /dev/rtc. (easier for me)
however there are 2 questions:
1) _apart_ from unexpected effects like trashing, etc
could I effectively expect some maximum value for "offset" after some
iterations? (i.e. would "offset" stay constant after lets say 100
iterations given a normal system and no extra load).
2) Is there a better way to achieve what I want? Did I miss smthg?
your ideas would be welcome.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org
-----END PGP SIGNATURE-----
To Unsubscribe: send mail to majordomo@xxxxxxxxxxx
with "unsubscribe freebsd-realtime" in the body of the message