The following example allows two (or more) multiplication tables to be printed out simultaneously.
First, the function to print out a multiplication table.
(defun print-table (number total stream)
(do ((i 1 (+ i 1)))
((> i total))
(format stream "~S X ~S = ~S~%" number i (* i number))
Note the use of process-allow-scheduling to allow the process to be interrupted once during each iteration of the do loop.
Now we define the function that calls
(defun process-print-table (name number total)
(mp:process-run-function name nil
#'print-table number total *standard-output*))
argument is used because no keywords are specified.
can now be called from two separate Listener windows to print out different multiplication tables simultaneously, for example:
(process-print-table "t1" 5 50)
in one Listener and:
(process-print-table "t2" 6 50)
in another Listener.
LispWorks User Guide and Reference Manual - 21 Dec 2011