From: Tamas Papp
Subject: lisp threads
Date: 
Message-ID: <87lket9t9l.fsf@pu100877.student.princeton.edu>
Hi,

I need a thread to run in the background without interrupting the flow
of my program (refresh an X window if exposed).  I tried to read about
threads in Lisp on Cliki: bordeaux-threads doesn't support my
implementation (CMUCL, I could switch to SBCL if necessary) [1],
claiming that there are no threads in in CMUCL, yet CMUCL's
documentation says that "CMUCL supports Lisp threads for the x86
platform." [2]  

Questions:

1. what are "Lisp threads" that CMUCL supports?  Where could I learn
more about them?

2. what is the portable (at least on Linux) way to write threads in
Common Lisp?

3. are there any good tutorials for getting started?

Thanks,

Tamas

[1] http://common-lisp.net/project/bordeaux-threads/
[2] http://common-lisp.net/project/cmucl/doc/cmu-user/extensions.html#toc66

From: Chun Tian
Subject: Re: lisp threads
Date: 
Message-ID: <1181404030.293856.203040@o11g2000prd.googlegroups.com>
On Jun 9, 9:01 pm, Tamas Papp <······@gmail.com> wrote:
> Hi,
>
> I need a thread to run in the background without interrupting the flow
> of my program (refresh an X window if exposed).  I tried to read about
> threads in Lisp on Cliki: bordeaux-threads doesn't support my
> implementation (CMUCL, I could switch to SBCL if necessary) [1],
> claiming that there are no threads in in CMUCL, yet CMUCL's
> documentation says that "CMUCL supports Lisp threads for the x86
> platform." [2]
>
> Questions:
>
> 1. what are "Lisp threads" that CMUCL supports?  Where could I learn
> more about them?

CMUCL doesn't support native pthreads, only green threads, in one cpu.
I
think you should turn to SBCL, which support pthreads in sb-thread, if
you want SMP support,

See http://www.sbcl.org/manual/Threading.html#Threading

It seems that the Bordeaux Threads[1] project you gave is a better
solution,
portable lisp code is better.

>
> 2. what is the portable (at least on Linux) way to write threads in
> Common Lisp?
>
> 3. are there any good tutorials for getting started?
>
> Thanks,
>
> Tamas
>
> [1]http://common-lisp.net/project/bordeaux-threads/
> [2]http://common-lisp.net/project/cmucl/doc/cmu-user/extensions.html#toc66
From: Alex Mizrahi
Subject: Re: lisp threads
Date: 
Message-ID: <466afe2c$0$90265$14726298@news.sunsite.dk>
(message (Hello 'Tamas)
(you :wrote  :on '(Sat, 09 Jun 2007 15:01:10 +0200))
(

 TP> documentation says that "CMUCL supports Lisp threads for the x86
 TP> platform." [2]

CMUCL has green threads -- this means that scheduling is performed in 
user-space, by CMUCL itself, unlike "real" kernel-scheduled threads.
afair there are two modes for CMUCL thread scheduling -- one needs explicit 
calls to (yield), where scheduler can switch thread.
second mode uses UNIX signal to switch threads periodically.
later approach might work in your case, but afaik it's not 100% supported.

 TP> 2. what is the portable (at least on Linux) way to write threads in
 TP> Common Lisp?

it's not a big deal -- spawning a thread is just one function, so you can 
write your own "portable" function with help of #+.

besides that, there are plenty of sinchonization things -- mutexes, 
semaphores etc. it's a bit more complex and varies between implementations.

if that bordeaux-threads do not suit you, you can check KMRCL[1] -- it's a 
bigger library with many stuff. it's threading compatibility wrappers seem 
to include support for CMU, SB, ACL and Lispworks.
although i suspect there might be a better one..

[1]: http://files.b9.com/kmrcl

)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
"I am everything you want and I am everything you need")