(defpackage #:coretest (:use :cl)) (in-package :coretest) (defun run-thing (f) (ccl:process-run-function (format nil "~A" (random 1.0d0)) f)) (defun kill-thing (p) (format t "Killing ~A~%" p) (ccl:process-kill p)) (defvar *test-threads* nil) (defun start-threads (n f) (loop repeat n do (push (run-thing f) *test-threads*))) (defun stop-threads () (loop while *test-threads* do (kill-thing (pop *test-threads*)))) (defun consing-f () (let ((x 2.0d0)) (dotimes (i most-positive-fixnum) (setf x (sqrt x))) x)) (defun nonconsing-f () (let ((x 2.0d0)) (declare (double-float x) (optimize (speed 3) (safety 0))) (dotimes (i most-positive-fixnum) (declare (fixnum i)) (setf x (sqrt x))) x))