cl-cpus is a Common Lisp feature to get number of CPUs.
Copyright (c) 2017 Muyinliu Xing Released under the ISC License.
Note: the Linux part of code comes from Edmound Weitz's book Common Lisp Recipes.
Common Lisp | Linux | Mac | Unix | Windows |
---|---|---|---|---|
SBCL | Yes | Yes | Yes | |
CCL | Yes | Yes | Yes |
Note: I don't have Unix system so haven't test on Unix yet.
In shell:
git clone https://github.com/muyinliu/cl-cpus.git
cp -r cl-cpus ~/quicklisp/local-projects/
In Common Lisp:
(ql:quickload 'cl-cpus)
(cpus:get-number-of-processors)
will get number of CPUs:
8