From owner-freebsd-realtime Wed Aug 8 14:53: 4 2001 Delivered-To: freebsd-realtime@freebsd.org Received: from chillig.lo-res.org (www.fastforward.at [62.116.8.2]) by hub.freebsd.org (Postfix) with ESMTP id 895AE37B432 for ; Wed, 8 Aug 2001 14:52:57 -0700 (PDT) (envelope-from aaron@lo-res.org) Received: from chillig.lo-res.org (localhost [127.0.0.1]) by chillig.lo-res.org (8.11.3/8.11.3) with SMTP id f78LqsX04390 for ; Wed, 8 Aug 2001 23:52:55 +0200 (CEST) (envelope-from aaron@lo-res.org) Content-Type: text/plain; charset="iso-8859-1" From: aaron To: freebsd-realtime@freebsd.org Subject: soft RT Date: Wed, 8 Aug 2001 23:52:41 +0200 X-Mailer: KMail [version 1.2] MIME-Version: 1.0 Message-Id: <01080823524107.03937@chillig.lo-res.org> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-realtime@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi everybody.... 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 sync. 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? : loop-start: send "now" signal to sound output program; usleep(microsecs); 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. loop; 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. greetings, aaron. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7cbSp6bxke2EQxE0RAlZXAKCVyZyHVmcGEc7nIn42/J+cL0BJ3ACg27AI x/qIincHJV2UWynW4QuKeW0= =uJ1H -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-realtime" in the body of the message