Subject: Re: TBNL Question
From: Pete Kazmier <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Fri, 28 May 2004 09:44:32 -0400

On Tue, 2004-05-25 at 13:30, Edi Weitz wrote:
> On Tue, 25 May 2004 13:19:21 -0400, Pete Kazmier <[email-masked]> wrote:
> > I'd be interested in playing around with TBNL as the other
> > frameworks I found did not look nearly as promising (no separation
> > of code/content, sessions created for all requests even if not
> > needed, etc ...).  Marc Battyani has pointed me to a couple of
> > versions of mod_lisp for Apache 2.x that other users have
> > contributed, and I thought I'd try those with TBNL.
> 
> Please go ahead and try. I'm aware of the mod_lisp code for Apache 2.x
> but haven't had the time to test it and integrate it with TBNL yet.
> 
> If your tests are successful please send reports (and maybe patches)
> to the mailing list (see Cc).

I'm happy to report that I was able to get TBNL working with Apache 2.x
using one of the versions of mod_lisp2 that Marc Battyani has in his
contrib/ directory[1] using both SBCL (0.8.10.54 w/ sb-thread) and CMUCL
(CVS release-18e-branch + minimal debian patches).

At first I had some difficulties because I'm new to Lisp and the Lisp
development environment (ASDF, Slime, familiarity w/ the top-level). 
When I first started up TBNL, the top-level never came back with a
prompt.  As this was all new to me, I wasn't sure if the problem was
mod_lisp, SBCL, or TBNL.

First I started by trying the other versions of mod_lisp2, but that did
not fix the problem, nor did they work nearly as well as [1].  I then
installed CMUCL and things started to work as expected.  Next, I went to
the source and tracked my problem down to KMRCL:MAKE-PROCESS:

(defun make-process (name func)
  #+allegro (mp:process-run-function name func)
  #+cmu (mp:make-process func :name name)
  #+lispworks (mp:process-run-function name nil func)
  #+sb-thread (sb-thread:make-thread func)
  #-(or allegro cmu lispworks sb-thread) (funcall func)
  )

I did not know about the #+/#- reader macro, but it was pretty obvious
what it was doing.  After checking the feature list in my SBCL, I
realized that I did not build SBCL with thread support.  Consequently,
MAKE-PROCESS would just run the function in the foreground (the last
case in the above code).  I then tried to search for an SBCL equivalent
of CMUCL MP package, but was not able to find anything.  Thus, I simply
rebuilt my version of SBCL to use threads (which was possible as I'm
running this on my linux/intel box).  Other users of non-threaded
versions of SBCL will have to find another option I suppose.

Long story short, I am now able to use TBNL with Apache 2.x using SBCL
(as long as its compiled with the sb-thread feature).  I've been trying
to subscribe to this dev-list but due to the problems with
common-lisp.net, I have not been able to.  If there are any replies,
please CC me directly (and I'll subscribe when the site comes back
online).

Thanks,
Pete

[1] The version of mod_lisp2 that I am using:
http://www.fractalconcept.com:8000/public/open-source/mod_lisp/contrib/mod_lisp2-2.c