home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / aijournl / 1986_09 / cli.des < prev    next >
Text File  |  1986-06-07  |  1KB  |  40 lines

  1.  
  2.  
  3. The Heart of the CLI Interpreter
  4.  
  5.         COBEGIN
  6.           - Input:   the forms to be evaluated concurrently (the tasks)
  7.             Output:  a list of the values to these forms
  8.           - initialize pseudo clock used to switch between tasks
  9.           - create a stack group for each concurrent task
  10.           - initiate concurrent execution
  11.           - create a list of the values of the tasks
  12.  
  13.         CLI_EVAL
  14.           - Input:   a form to be evaluated
  15.             Output:  the value of the form
  16.           - increment pseudo clock
  17.           - if switching is enabled
  18.                and we have reached the end of a time slice
  19.                and we are in concurrent mode,
  20.             then
  21.               - suspend current task and enable switching
  22.             else
  23.               - evaluate the form
  24.               - return the value
  25.  
  26.         SWITCH-AROUND
  27.           - Input:   none
  28.             Output:  none
  29.           - if all tasks are complete,
  30.             then
  31.               - return
  32.             else
  33.               - randomly choose a task to execute
  34.               - if this task has completed,
  35.                 then
  36.                   - eliminate it from the list of tasks
  37.                   - try again
  38.                 else
  39.                   - initiate task execution
  40.