Subject: fork

From: David Tillman <[email-masked]>
Date: Fri, 13 Nov 1998 15:24:48 -0600

I believe I have asked this before, but did not
  get a satisfactory answer.

  Is there a way to fork in CLISP?

  Thanks, Dave.

---

From: Gilbert Baumann <[email-masked]>
Date: 23 Nov 1998 10:34:19 +0100

>   Is there a way to fork in CLISP?

  Could you elaborate, what you actually want to accomplish? 
  
  Do you want a truly UNIX fork(), which creates a copy of a
  [unix] process?
  
  Or do you want something along the line of multi-threading?
  
  Multi-threading for CLISP is underway, but do not wait for something
  useful any time soon. If you need multi-threading for your Lisp
  application, I must unfortunately suggest competing implementations,
  which have multi-threading like ACL or perhaps CMUCL.

  Or do you want to spawn another unix-program from within CLISP?
  Well, here is the LISP:SHELL function your friend.

  Or do you want to accomplish something different?

Gilbert.

-- 
;;; You know you have hacked Lisp too much, when you m-c-x in a C buffer.

---

From: David Tillman <[email-masked]>
Date: Mon, 23 Nov 1998 10:16:35 -0600

>>>>> Gilbert Baumann <[email-masked]> writes:

>   Could you elaborate, what you actually want to accomplish?

  This is for a webserver I am working on. I am aware of CL-HTTP
  and I am not trying to re-invent the wheel.

>   Or do you want something along the line of multi-threading?

  Multi-threading would be much more desirable. I realize that this
  is not quite posible with CLISP at the moment.
  
>   Multi-threading for CLISP is underway, but do not wait for
> something useful any time soon. If you need multi-threading for
> your Lisp application, I must unfortunately suggest competing
> implementations, which have multi-threading like ACL or perhaps
> CMUCL.

  I am using CMUCL at the moment because it has an actual fork.
  I have a copy of ACL but cannot use it for this application
  because it will probably get used commercially. Perhaps I can
  purchase a copy later.

>   Or do you want to spawn another unix-program from within
> CLISP?  Well, here is the LISP:SHELL function your friend.

>   Or do you want to accomplish something different?

  I want to run multiple instances of the server to handle heavy
  loads. Threads would be great for this. As of now I simply specify
  in a config file how many servers to start and I have separated out
  CMUCL specific fork and inet stuff into separate modules so as to
  make it as portable as possible.

  I do the fork right before the accept and let the OS determine
  which process gets the connection. At first I tried doing the
  networking stuff in C and communicating with CLISP by way of pipes,
  but it was just too much of a kludge.

  It still works with CLISP, I just have to fake the results from the
  fork procedure.

> -- ;;; You know you have hacked Lisp too much, when you m-c-x in
> a C buffer.

  Yeah, or when you keep typing (exit) at the shell prompt...

--
David Tillman           | Sparrow Information Systems | Contract C, C++, and
[email-masked] |     www.sparrowsys.com      | PERL code for UNIX.