スレッドを生成する:ScineerCL - lisp-cookbook-ja/common-lisp GitHub Wiki
スレッドを生成する:ScineerCL
Scineer CLでの例
Scineer CLでは主にMPパッケージにまとめられています。
(defpackage :thread-test
(:use :cl :portable-threads))
(in-package :thread-test)
(progn
(print "Test start")
(let ((p (mp:make-process
(lambda ()
(print "Start thread" #.*standard-output*)
(sleep 3)
(print "End thread" #.*standard-output*))
:name "test")))
(print "Waiting for the thread to complete")
(mp:process-wait "wait" (lambda () (not (mp:process-alive-p p))))
(print "Test compleated")))
;-> "Test start"
; "Start thread"
; "Waiting for the thread to complete"
; "End thread"
; "Test compleated"
;=> "Test compleated"