[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

programming hints?



Hi:  I'm about to start a significant piece of lisp programming, and I'd
appreciate any *software* hints to implement my goal,
i.e., what programming structure and techniques are likely to work best.


What I have:  I have developed an expert system to control a certain
analytical instrument here at Varian.  (Sorry I must be somewhat
vague about this) The ES has been developed in Genera 8.0, and ported to
SUN's Lisp 4.0 (really Lucid) running on Sparcstations.    The running
system looks like the following:
                     

                               NFS
    --------------------------------------------------------------
                 |                              |
            --------------                --------------   -------------
            |            |                |            |   |           |
            |            |                |            |---|           |
            --------------                --------------   -------------
                  ESHOST                    INSTRUMENT        INSTRUMENT
                  (SUN)                     HOST (SUN)        (VARIAN BEAST)

The ES starts up, acquires some initial data from the IHOST, decides
what the instrument should do, and sends a high level instrument control
instruction to a C based control program running on the IHOST.   The ES
then sleeps, periodically probing the IHOST for an endfile.   The IHOST
program executes the instruction received from the ESHOST and, when
finished, writes the endfile.   The ESHOST detects the endfile, acquires
some new data, and re-considers what to do next.   This loop continues
for a few hours, and consists of about 8 cycles (~ 1/2 hour per cycle) .
The ES lisp program is sleeping 99 % of the time .  This whole setup is
obviously crude but turns out to be very robust and works fine in
practice.



What I need to do:  I want the ESHOST to simultaneously
control several (up to 4) IHOSTS.   So far, I've managed to control 2
instruments simultaneously by resuming two copies of the ES on ESHOST,
one for each IHOST. (that is, I run two lisp "worlds")  This works, but
requires 200 Megs of swap space on the eshost, and even so, seriously
degrades the eshost performance for other processes that are running.
Clearly, I want to have one ES program image control several IHOSTS.
This seems quite possible.   My ES reasons by using predicate logic
rules that operate on facts represented as properties of objects.   The
program has a sense of which IHOST is being controlled, and it would be
straightforward to create multiple sets of objects and rule bases
corresponding to a list of IHOSTS.   What I'm imagining is that the ES
would service IHOST-1 until it gets to that function call wherein it currently
sleeps.   Instead of sleeping it would switch to servicing IHOST-2, etc.

(1) I'm unclear about  how to best save and restore the program
state when the es switches from processing IHOST-1 to IHOST-2 etc.
I would prefer to not reinvent multiprocessing.
(2) Any suggestions as to an alternate way to handle the multi-instrument
control?
(3) Any and all hints, comments, suggestions and pointers are welcome.

Thanks in advance,
Joe Karnicky