[comp.lang.forth] Forth and Realtime

jax@well.sf.ca.us (Jack J. Woehr) (04/09/90)

skip@rafos.UUCP (Skip Carter) writes:


>	I have been using Forth for instrumentation control for some
>time and after reading the current issue of Embedded Systems (Multitasking
>Mania) it occurred to me that many real-time systems could run under
>Forth.  What is the general experience when using the various multitasking
>mechanisms when the system requires real-time responses ?

	There are some advantages to the cooperative round-robin, Skip.

	Here's an example from my work this week:

	Client bought one of our Forth single-boards. There are four
bits of one I/O port that, in addition to being "just plain" output
lines, also control a multiplexer which selects A2D (analog-to-digital)
channel.

	In the background, a task is gathering data from six A2D channels.
Meanwhile, in another task, the gathered data is being written to an LED
display. The Catch: those four magic bits of that one I/O port are being
used to write the display.

	Observing that the display write will trash the 300 uSec ongoing
A2D conversion I simply ... don't PAUSE till conversion done. No handwaving
required to disable preemptive multitasking ... just no PAUSE in the delay
loop.

{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
{} jax@well     ." Sysop, Realtime Control and Forth Board"      FIG      {}
{} jax@chariot  ." (303) 278-0364 3/12/2400 8-n-1 24 hrs."     Chapter    {}
{} JAX on GEnie       ." Tell them JAX sent you!"             Coordinator {}
{} jax@well.sf.ca.us   Now Starting to Attend ANSI X3J14   and going bald {}
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}