Re: Best way to approach this ???

Steve Lamont (spl@szechuan.ucsd.edu)
Tue, 3 Dec 96 08:19:06 PST

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> Which would be the best way to approach integrating a XFORMS GUI
> with real time processes?

With a sharp stick and heavy gloves.

> My real-time stuff is audio playback (or even audio generation
> or modification with playback).
>
> It will be hard to "identify" any idle point in the cpu cycles.
>
> a) Perhaps using 2 processes with shared memory?
>
> b) 2 processes with pipes?
>
> c) Something else????

I built a multi-tasking real-time application using TCP/IP sockets
(TCP and UDP datagram service), signals, shared memory, message
queues, and semaphores. In other words, darn near the whole ball of
interprocess communication wax.

Shared memory was used to transfer blocks of data between processes,
the message queues were used to send short messages between the
processes, and semaphores were used for serialization of resource use
(locking of critical sections, etc.).

The system is broken into several modules and each module can run
on a separate machine. Each module, in turn can spawn multiple
threads (in fact all of them do, since there is a master scheduler
thread, a TCP/IP communications thread, and at least one "worker"
thread). A facility for dynamically creating and removing threads as
necessary was incorporated although in practice it was used less often
than originally anticipated -- threads tended to get spawned at the
beginning of the run and stay alive till the end.

Modules on separate machines communicate through TCP/IP sockets.

The only thing I didn't use was Unix pipes.

The GUI for this project is Motif based rather than XForms based for
reasons that have nothing to do with the suitability of XForms -- in
fact, I would have been happier using XForms had it been available in
a stable state when I started this whole mess about 3 years ago (and
the constraints of the project allowed me to use it in any case).

Say "yeek!"

The books _UNIX(r) Network Programming_ by W. Richard Stevens
(Prentice Hall, ISBN 0-13-949876-1) and _Advanced Programming in the
UNIX(r) Environment_ (Addison-Wesley, ISBN 0-201-56317-7), also by
Stevens, were invaluable in sorting the whole mess out.

A about a year and a half ago, a lot of these ideas got incorporated
into another project (our CMDA/"Telemicroscopy" project) and got
turned into something called ACE (Asynchronous Communication
Environment) by my late collegue David Hessler and Gary Hanyzewski
from the San Diego Supercomputer Center. If you're interested in
using it, see the ACE homepage:

http://www.sdsc.edu/~garyh/software/ace.html

It is available for Sun (4.1.x), SGI, and HP systems in binary only
pre-release.

Speaking of CMDA, it is XForms based. If you're interested in seeing
what we've done with it, point your browser at

http://www-ncmir.ucsd.edu/CMDA.html

spl
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html