From: Wout Perquin
Subject: sockets and threads and special forms|operators
Date: 
Message-ID: <1156023770.702893.210250@h48g2000cwc.googlegroups.com>
Hi All, Common Lisp the Language 2nd edition (Steele) doesnt specify
threads nor sockets.
Allegro Lisp (alisp) implements both, but clisp for instance doesnt
(yet ?) implement threads.
I assume that to implement threads additional special forms|operators
need to be implemented as well.  Is that a correct assumption ?

From: Barry Margolin
Subject: Re: sockets and threads and special forms|operators
Date: 
Message-ID: <barmar-0791C8.00333120082006@comcast.dca.giganews.com>
In article <························@h48g2000cwc.googlegroups.com>,
 "Wout Perquin" <············@skynet.be> wrote:

> Hi All, Common Lisp the Language 2nd edition (Steele) doesnt specify
> threads nor sockets.

Correct.  Neither does ANSI C or C++.

> Allegro Lisp (alisp) implements both, but clisp for instance doesnt
> (yet ?) implement threads.
> I assume that to implement threads additional special forms|operators
> need to be implemented as well.  Is that a correct assumption ?

I think most implementations do threads with ordinary functions and 
macros, comparable in many ways to the Pthread library in POSIX.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: Marcin 'Qrczak' Kowalczyk
Subject: Re: sockets and threads and special forms|operators
Date: 
Message-ID: <87u042ur3y.fsf@qrnik.zagroda>
Barry Margolin <······@alum.mit.edu> writes:

>> I assume that to implement threads additional special forms|operators
>> need to be implemented as well.  Is that a correct assumption ?
>
> I think most implementations do threads with ordinary functions and 
> macros, comparable in many ways to the Pthread library in POSIX.

I doubt that. There are many reasons why threads might require
changing the runtime, many mechanisms which might have an implementation
which works only under the assumption that it's used by a single
thread at a time:

- binding special variables
- interning symbols
- garbage collection
- the evaluator, if it's an interpreter
- returning multiple values
- handling conditions
- the debugger

-- 
   __("<         Marcin Kowalczyk
   \__/       ······@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/
From: Barry Margolin
Subject: Re: sockets and threads and special forms|operators
Date: 
Message-ID: <barmar-D55670.17484424082006@comcast.dca.giganews.com>
In article <··············@qrnik.zagroda>,
 Marcin 'Qrczak' Kowalczyk <······@knm.org.pl> wrote:

> Barry Margolin <······@alum.mit.edu> writes:
> 
> >> I assume that to implement threads additional special forms|operators
> >> need to be implemented as well.  Is that a correct assumption ?
> >
> > I think most implementations do threads with ordinary functions and 
> > macros, comparable in many ways to the Pthread library in POSIX.
> 
> I doubt that. There are many reasons why threads might require
> changing the runtime, many mechanisms which might have an implementation
> which works only under the assumption that it's used by a single
> thread at a time:
> 
> - binding special variables
> - interning symbols
> - garbage collection
> - the evaluator, if it's an interpreter
> - returning multiple values
> - handling conditions
> - the debugger

Those require changes to the implementation of existing special 
operators, not the addition of new ones.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: Pierre THIERRY
Subject: Re: sockets and threads and special forms|operators
Date: 
Message-ID: <pan.2006.08.20.10.30.51.237860@levallois.eu.org>
Le Sat, 19 Aug 2006 14:42:50 -0700, Wout Perquin a écrit :
> I assume that to implement threads additional special forms|operators
> need to be implemented as well. Is that a correct assumption ?

Just go check how the current Lisps have added sockets and threads. Did
they add special forms?

For example:
- http://www.sbcl.org/manual/Threading.html
- http://www.sbcl.org/manual/Networking.html

I'm pretty sure that implementing sockets and threads could be done with
an FFI library like CFFI our UFFI.

Portably,
Nowhere man
-- 
···········@levallois.eu.org
OpenPGP 0xD9D50D8A
From: bradb
Subject: Re: sockets and threads and special forms|operators
Date: 
Message-ID: <1156456671.830666.49760@74g2000cwt.googlegroups.com>
Pierre THIERRY wrote:
> Le Sat, 19 Aug 2006 14:42:50 -0700, Wout Perquin a écrit :
> > I assume that to implement threads additional special forms|operators
> > need to be implemented as well. Is that a correct assumption ?
>
> Just go check how the current Lisps have added sockets and threads. Did
> they add special forms?
>
> For example:
> - http://www.sbcl.org/manual/Threading.html
> - http://www.sbcl.org/manual/Networking.html
>
> I'm pretty sure that implementing sockets and threads could be done with
> an FFI library like CFFI our UFFI.
>

Sockets, yes - threads, maybe not.  The runtime image might make some
pretty thread unsafe assumptions.

Cheers
Brad