:)
nobody talking here, so quite. :(
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
(define (child-process)
(setq ppid (sys-info 6)) ; get parent pid
(setq cur-pid (sys-info 7))
(while true
(if (receive ppid msg)
(begin
;; get new message from queue
(append-file (string cur-pid ".log") (string msg "n"))
)
(begin
;; get nothing from queue, sleep 1 second
(sleep 1000)
)
)
)
)
(load "args.lsp")
(parse-args)
(setq process-number (int (ArgsTree "--process-number")))
(define (child-process)
(setq ppid (sys-info 6)) ; get parent pid
(setq cur-pid (sys-info 7))
(while true
(until (receive ppid msg)
(append-file (string cur-pid ".log") (string msg "n"))
(sleep 1000)
)
)
)
; parent starts child processes
(dotimes (i process-number)
(spawn 'result (child-process) true)
)
;; parent send one msg to each child process
(setf child-process-list (sync))
(println "child-process-list: " child-process-list)
(dolist (cpid child-process-list)
(println "child process: " cpid)
(send cpid "test msg")
)
;; quit in 10 seconds
(sleep 10000)
(abort)
(exit)
Quote
nil
test msg
test msg
test msg
test msg
test msg
test msg
test msg
test msg
test msg
Quotehttp://localhost/wind_tunnel/clusters/%E8%B7%9F%E8%B8%AA%E7%B3%BB%E7%BB%9F/hosts">http://localhost/wind_tunnel/clusters/跟踪系统/hosts
Quotehttp://localhost/wind_tunnel/clusters/%E8%B7%9F%E8%B8%AA%E7%B3%BB%E7%BB%9F/hosts"> http://localhost/wind_tunnel/clusters/% ... B%9F/hosts">http://localhost/wind_tunnel/clusters/%E8%B7%9F%E8%B8%AA%E7%B3%BB%E7%BB%9F/hosts
;; @syntax (Graph:get-node node-name)
;; @description
;; <p>If you want to get a Node out of the Graph (e.g. in order to extract
;; its properties), then use the following function to get it by name.</p>
;; @example
;; (println (:get-node my-dag "G")) ;;=> (Node "G" sad)
;; (println (:get-node my-dag "Does not exist")) ;;=> nil
(define (Graph:get-node node-name)
(and (find (list 'Node node-name '*)
(:nodes (self))
match)
$0))
(setq product-node (:get-node my-dag "result"))
(push "2014-12-12 10:10" product-node -1)
(println product-node)
(println (:get-node my-dag "result"))
bson_t * bson_new_from_json (const uint8_t* data, ssize_t len, bson_error_t *error);
(import bson-lib "bson_new_from_json" "void*" "void*" "unsigned int" "void*")
;; I also tried to use char* instead
;; (import bson-lib "bson_new_from_json" "void*" "char*" "unsigned int" "void*")
;; @syntax (mongo:bson-new-from-json json-str)
;; @return the pointer of bson_t
(define (bson-new-from-json json-str)
(bson_new_from_json json-str (length json-str) 0)
)
(load "mongo.lsp")
(set 'cmd-str "{stats:true}")
"{stats:true}"
> (mongo:bson-new-from-json cmd-str)
0