Problems with Processes

From: Sean Slattery <jslttery_at_GS148.SP.CS.CMU.EDU>
Date: Sat, 15 Apr 1995 14:51:16 -0400

We're having trouble using run-process. The command seems to make my computer
thrash about vigourously for a few seconds and then kill stk - I believe
what's happenning is that stk is chewing up virtual memory at an amazing rate
(I started at 21M free) and the OS is killing it before all the virtual memory
is gone. Anyone else seen this behaviour?

I'm on a PowerPC running AIX3.2.5

Two other questions:

a) Are process supposed to be removed from (process-list)? I'm confused by the
following behaviour (on a SunOS 4.1.3)

STk> (run-process "ls" "-l" "/bin" :output "/tmp/X" :wait #f)
#<process PID=609>
STk> (process-list)
(#<process PID=609>)
STk> (process-wait (car (process-list)))
STk> (process-list)
(#<process PID=609>)

My reading of the manual (page 38) says that process-wait returns #f if the
process was already terminated when the call was made, but that process-list
only returns the list of processes that are currently running. Am I misreading
the manual, or is this a feature?

b) STk seems to want to convert the result of a get command on a listbox to a
list. This means that we run into trouble if our listbox entries have comma's
or brackets in them (they get converted into (unquote ...) and sublists
respectively). The man page does not state that <pathname> get <index> returns
a list. I think it would make more sense for STk to keep this return value as
a string to allow the user the maximum latitute in inserting stuff into the
listbox that they later want to retrieve. Comments?

One more thing - the slib common-lisp-time stuff doesn't seem to work - it
falls back to using the counter. Please find appended my first stab at code to
provide STk will a real universal time using the Unix date command - I hope
the output of date is identical over machines, I've tested this on Sun running
Mach and SunOS 4.1.6, DecStation running Mach, and a PowerPC running AIX
3.2.5. It's not good scheme code, but it works :)


;;; After loading this code - all the functions from 'common-list-time should
;;; work properly

(require "slib")
(require 'common-list-functions)

;; (nth n list)
(defmacro nth args
  `(car (nthcdr ,_at_args)))

;; My hacked version of the time stuff
(require 'common-lisp-time)
(require 'alist)

(define date-parse-re
  (string->regexp "[A-Za-z]+ ([A-Za-z]+) ([0-9]+) ([0-9]+):([0-9]+):([0-9]+)
[A-Za-z]+ ([0-9]+)"))
(define months '(("Jan" 1) ("Feb" 2) ("Mar" 3)
                 ("Apr" 4) ("May" 5) ("Jun" 6)
                 ("Jul" 7) ("Aug" 8) ("Sep" 9)
                 ("Oct" 10) ("Nov" 11) ("Dec" 12)))
(define assoc-string-ci=?
  (predicate->asso string-ci=?))
(define get-universal-time
  (lambda ()
          (lambda (str res)
            (string->number (substring str (car res) (cadr res))))))
      (let* ((date-string (call-with-input-file "| date" read-line))
             (results (date-parse-re date-string))
             (second-res (nth 5 results))
             (minute-res (nth 4 results))
             (hour-res (nth 3 results))
             (day-res (nth 2 results))
             (month-res (nth 1 results))
             (year-res (nth 6 results)))
         (get-number-field date-string second-res)
         (get-number-field date-string minute-res)
         (get-number-field date-string hour-res)
         (get-number-field date-string day-res)
         (cadr (assoc-string-ci=?
                (substring date-string (car month-res) (cadr month-res))
         (get-number-field date-string year-res))))))
Received on Sat Apr 15 1995 - 20:52:49 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST