[slime-devel] Threads attributes

Helmut Eller heller at common-lisp.net
Tue Jun 23 21:35:05 UTC 2009


* Terje Norderhaug [2009-06-23 22:07+0200] writes:

> Another possibility is to have the list-threads response include a  
> declaration of the structure of the items in the list. For example,  
> the first item could be a list of symbols labeling the data, as in  
> this amended response from swank:list-threads:
>
> ((id name status description)
> (18 "worker" "Active" "")
> (16 "repl-thread" "Semaphore timed wait" "")
> (15 "auto-flush-thread" "Sleep" "")
> (12 "reader-thread" "Active" "")
> (11 "control-thread" "Semaphore timed wait" "")
> (2 "Swank 0" "Active" "")
> (1 "listener" "Active" "")
> (0 "Initial" "Sleep" ""))
>
> Benefits of heading with such a declaration vs using a detailed  
> property list for each item includes less redundancy and that a swank  
> client can make decisions about how to present the items in the list  
> before processing the rest of the response.
>
> Implementations can then add process attributes like priority,  
> creation-time, total-run-time, last-run-time, idle-time etc,  
> preferably using consistent labels.
>
> -- Terje Norderhaug

Yet another possibility would be to pass the interesting attributes
as input to swank:list-threads.  E.g.

(list-threads '(:id :name :status :description :priority :total-runtime))
=>  ((18 "worker" "Active" "" 10 0.2)
     (16 "repl-thread" "Semaphore timed wait" "" 5 0.3))

Perhaps complemented with a function to find out all possible attribute
names.

Helmut.





More information about the slime-devel mailing list