ecl是一种common lisp,特点是可以结合进C语言,至于效率,文档语焉不详,故也没有仔细研究。
下载了源代码后,普通的./configure配置make后生成的编译器是不能直接利用mp多线程库的,故./configure的过程要仔细研究。通过./configure --help可以得知有一个选项--enable-threads默认是关闭的,重新配置./configure --enable-threads,并make,此时启动ecl,出现了以下的界面:
ECL (Embeddable Common-Lisp) 10.4.1
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.
Top level in: #<process SI:TOP-LEVEL 0000000001bf6f60>.
>
注意倒数第二行出现了#<process SI:TOP-LEVEL 0000000001bf6f60>,这说明mp库可以使用了。
在ecl文档里有mp库函数的大致介绍,但是说实话,如果没有多线程编程的基础知识,很难看懂它在说什么。大致说来,多线程编程需要把业务分成许多并列的部分,然后开几个线程来分别完成这些业务。所以需要有函数mp:process-run-fun