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

Help programming processes (monitoring subordinate processes)



From: rpg@cs.brown.edu             
Date: 17-Jan-90 16:26    

Unfortunately, I haven't been able to figure out how to monitor the
subordinate process for the following conditions:
-completion of function
-error condition

	A way to do this is to have your story process and monitor
 	process communivate using shared memory cells. ie

	(defvar *completed-p* nil)
	(defvar *error-p* nil)

	(defun process-a-story (story)
	  (condition-bind ((error 
			     #'(lambda (c)
				 (store-conditional (locf *error-p*)
						    nil 
						    ':in-error)
				 (dbg:enter-debugger c))))
	    ;; do the story
	    ...
   	    (store-conditional (locf *completed-p*) nil ':done)))

	;;; for monitoring more than one process, make an
	;;; array of these variables indexed by process or something

	(defun process-hung-p (p)
	  (declare (ignore p))
	  *error-p*)

	(defun process-done-p (p)
	  (declare (ignore p))
	  *completed-p*)	
          
	I wrote this from memory so be sure to check arglists and
	stuff to make sure I'm using these functions correctly.

	Chris Maeda
	wannabe lispm hacker